GTK Action Handler

2009-12-31 Thread dhk
What is the callback signature suppose to look like for a GTK Action handler? I have a menu made from a GtkBuilder UI definition. The GtkActionEntry array sets the callbacks for the menu item; however, what is the callback suppose to look like? Some menu items I want to call a button clicked

Re: GTK Action Handler

2009-12-31 Thread Tadej Borovšak
Hello. Callback prototype for activate signal is: void callback( GtkAction *action, gpointer data ); When widget that proxies specific action is activated, it calls gtk_action_activate() function which emits activate signal. Tadej -- Tadej Borovšak tadeboro.blogspot.com tadeb...@gmail.com

Re: GTK Action Handler

2009-12-31 Thread dhk
Tadej Borovšak wrote: Hello. Callback prototype for activate signal is: void callback( GtkAction *action, gpointer data ); When widget that proxies specific action is activated, it calls gtk_action_activate() function which emits activate signal. Tadej I think I have one more

Re: GTK Action Handler

2009-12-31 Thread Michael Cronenworth
dhk wrote: How can I reuse these callbacks? Use user_function( GtkWidget *widget, gpointer data ) instead of explicitly setting a class. Then cast widget as whatever you need, eg.: GTK_BUTTON( widget ) inside of your callback. ___

Re: GTK Action Handler

2009-12-31 Thread dhk
Michael Cronenworth wrote: dhk wrote: How can I reuse these callbacks? Use user_function( GtkWidget *widget, gpointer data ) instead of explicitly setting a class. Then cast widget as whatever you need, eg.: GTK_BUTTON( widget ) inside of your callback.

Re: GTK Action Handler

2009-12-31 Thread Tadej Borovšak
Hello. When the button or expander is clicked with the mouse the callbacks work fine.  The problem is from the menu the activate signal has GtkAction as the first parameter of the callback and I don't think that can be cast to a GtkButton or GtkExpander.  I want to call the button and

Re: GTK Action Handler

2009-12-31 Thread Michael Cronenworth
dhk on 12/31/2009 10:33 AM wrote: When the button or expander is clicked with the mouse the callbacks work fine. The problem is from the menu the activate signal has GtkAction as the first parameter of the callback and I don't think that can be cast to a GtkButton or GtkExpander. I want to