On Fri, 24 Mar 2000, [EMAIL PROTECTED] wrote:
> I create several buttons and set names for them.
> Can I later in different function reach the button using it's name?
YES use :
GtkWidget *
 get_widget(GtkWidget * widget, gchar * widget_name)
{
    GtkWidget *parent, *found_widget;

    for (;;) {
        if (GTK_IS_MENU(widget))
            parent = gtk_menu_get_attach_widget(GTK_MENU(widget));
        else
            parent = widget->parent;
        if (parent == NULL)
            break;
        widget = parent;
    }

    found_widget = (GtkWidget *) gtk_object_get_data(GTK_OBJECT(widget),
                                                     widget_name);
    if (!found_widget)
        g_warning("Widget not found: %s", widget_name);
    return found_widget;
}

> Thanks,
> Didi

MfG 
Andreas Scherf

[EMAIL PROTECTED]             
http://www.fh-trier.de/~scherfa

"It said uses Windows 98 or better, so I loaded Linux!"

-- 
To unsubscribe: mail -s unsubscribe [EMAIL PROTECTED] < /dev/null

Reply via email to