Re: [gtk-list] Lookup Question



To all thanks,

I found a work around.
I added

gtk_object_set_data ( GTK_OBJECT ( New_Node_Button ) , "Node_List" , Node_List
);

in main, and used

NodeList = gtk_object_get_data ( GTK_OBJECT ( GTK_BUTTON ( was_clicked) ) ,
"Node_List" );

Thanks,
George

> Hello,
>
> What do you do if lookup() doesn't find your widget?
> I can see both my button and my list in the app window.
> The callback should place a simple text string in the list.
> Below is relavent info for the button and list setup, plus the callback.
> Do I need a "lookup_sibling" type of function?
> Thanks,
> George
> ========================
> void new_node_cb(GtkButton *was_clicked,  gpointer udata){
>     GtkWidget *NodeList;
>     NodeList = lookup_widget ( GTK_WIDGET ( was_clicked ) , "Node_List");
> . . .
> }
> ========================
> int main . . .
> . . .
> GtkWidget *Main_Window;
> GtkWidget *NodeList;
> GtkWidget *New_Node_Button;
> . . .
> Main_Window = gtk_window_new ( GTK_WINDOW_TOPLEVEL );
> Node_List  = gtk_list_new();
> New_Node_Button = gtk_button_new_with_label( "New Node");
> . . .
> gtk_widget_set_name ( Node_List , "Node_List" );
> . . .
> gtk_table_attach( Main_Table <=== Node_List );
> gtk_table_attach( Main_Table <=== New_Node_Button );
> . . .
> gtk_container_add ( Main_Window <=== Main_Table);
> . . .
> }
> ========================
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]