Re: MenuItem activate signal

2009-02-09 Thread Tristan Van Berkom
On Fri, Feb 6, 2009 at 6:56 PM, dhk wrote: [...] >>> I have a callback that is called when a MenuItem is selected, but in the >>> callback the paramenter is which is suppose to be the MenuItem is NULL. >>> The callback signature is "void user_function (GtkMenuItem *menuitem, >>> gpointer user_dat

Re: MenuItem activate signal

2009-02-06 Thread dhk
Carlos Pereira wrote: > I am fairly experienced with sensitive/insensitive states in Menuitems > in old Option Menus and new Combo Boxes, but I am not sure in which > context your Menuitem appears... > > Could you explain what is the parent of your MenuItems? perhaps with a > very small bit of cod

Re: MenuItem activate signal

2009-02-06 Thread Carlos Pereira
I am fairly experienced with sensitive/insensitive states in Menuitems in old Option Menus and new Combo Boxes, but I am not sure in which context your Menuitem appears... Could you explain what is the parent of your MenuItems? perhaps with a very small bit of code showing how they are created

Re: menuitem activate

2007-05-24 Thread DanH
> You have to find you what dv is, where is is constructed and > how to pass it where you set up the notify handler. DirView * dirview_create (const gchar *root_dir, GtkWidget *parent_win, GimvThumbWin *tw) { (...) dnotify is being slowly overtaken by inotify but

Re: menuitem activate

2007-05-24 Thread DanH
> If you know what action you want to invoke, you can also > call the callback function of the item directly (or some > other function that performs the requested action), can't > you? I guess it'll be shorter to start from the beginning. I'm messing around with GimageView 0.2.27. I want it to a

Re: menuitem activate

2007-05-24 Thread DanH
On Wed, 23 May 2007 16:49:50 +0200, David Neèas (Yeti) wrote > On Wed, May 23, 2007 at 10:36:13AM -0400, danielg RHCE wrote: > > > Why don't you just call the callback function which is connected to the > > > signal? > > > Or use g_signal_emit() or g_signal_emit_by_name() to "emulate" a > > > clic

Re: menuitem activate

2007-05-23 Thread Yeti
On Wed, May 23, 2007 at 03:00:03PM -0400, danielg Posting wrote: > > > It could look like: > > > > dv = ... set up the dir view ... > > /* And here comes your part */ > > setup_notify(dv, &refresh_me); > > Okay, I understand the setup_notify and the dv there, what's the refresh_me > for (d

Re: menuitem activate

2007-05-23 Thread danielg Posting
> You have to find you what dv is, where is is constructed and > how to pass it where you set up the notify handler. DirView * dirview_create (const gchar *root_dir, GtkWidget *parent_win, GimvThumbWin *tw) { (...) dnotify is being slowly overtaken by inotify but

Re: menuitem activate

2007-05-23 Thread Yeti
On Wed, May 23, 2007 at 12:38:58PM -0400, danielg Posting wrote: > > I guess it'll be shorter to start from the beginning. I'm messing around with > GimageView 0.2.27. Last release 2.5 years ago? No CVS commit in 2 years? Sounds like a dead project to me. I suggest not to waste your efforts an

Re: menuitem activate

2007-05-23 Thread danielg Posting
> If you know what action you want to invoke, you can also > call the callback function of the item directly (or some > other function that performs the requested action), can't > you? I guess it'll be shorter to start from the beginning. I'm messing around with GimageView 0.2.27. I want it to a

Re: menuitem activate

2007-05-23 Thread Yeti
On Wed, May 23, 2007 at 11:21:41AM -0400, danielg Posting wrote: > > and I'm trying to activate the refresh menu item. How would it know which > menuitem to activate? Leaving aside item factories have been deprecated for a long time: (a) you can store the item somewhere (e.g. in some struct) (b)

Re: menuitem activate

2007-05-23 Thread Yeti
On Wed, May 23, 2007 at 11:25:37AM -0400, danielg Posting wrote: > I'm just trying everything. > > Compiler complains if I don't put quotes around it (undeclared (first use of > this function)) , compiler doesn't complain when I do, but it segfaults. > > As I said, I've been out of this game

Re: menuitem activate

2007-05-23 Thread danielg Posting
On Wed, 23 May 2007 17:13:56 +0200, Jonathan Winterflood wrote > Not really GTK-related, but shouldn't the compiler have complained loudly > about passing a char* instead of a GtkMenuItem* ? > Or are you using a binding of gtk to a language that doesn't check > types at compile-time? I'm just try

Re: menuitem activate

2007-05-23 Thread danielg Posting
> http://developer.gnome.org/doc/API/2.0/gtk/GtkMenuItem.html#gtk-menu- > item-activate > > It has argument of GtkMenuItem* type, i.e. you pass the menu > item object. No path, name, or anything. The item itself > (that's menuitem here). > I'm with you on everything you said and I feel like a

Re: menuitem activate

2007-05-23 Thread Jonathan Winterflood
Not really GTK-related, but shouldn't the compiler have complained loudly about passing a char* instead of a GtkMenuItem* ? Or are you using a binding of gtk to a language that doesn't check types at compile-time? Jonathan On 5/23/07, David Nečas (Yeti) <[EMAIL PROTECTED]> wrote: > > On Wed, May

Re: menuitem activate

2007-05-23 Thread Yeti
On Wed, May 23, 2007 at 11:02:54AM -0400, danielg Posting wrote: > > > > gtk_widget_activate(item); or gtk_menu_item_activate(item); > > Okay, So, with this as the originator: > ifactory = gtk_item_factory_from_widget (dirview_popup); > (...) > menuitem = gtk_item_factory_get_item (ifactory, "/

Re: menuitem activate

2007-05-23 Thread danielg Posting
On Wed, 23 May 2007 16:49:50 +0200, David Neèas (Yeti) wrote > On Wed, May 23, 2007 at 10:36:13AM -0400, danielg RHCE wrote: > > > Why don't you just call the callback function which is connected to the > > > signal? > > > Or use g_signal_emit() or g_signal_emit_by_name() to "emulate" a > > > clic

Re: menuitem activate

2007-05-23 Thread Yeti
On Wed, May 23, 2007 at 10:36:13AM -0400, danielg RHCE wrote: > > Why don't you just call the callback function which is connected to the > > signal? > > Or use g_signal_emit() or g_signal_emit_by_name() to "emulate" a > > click on the menu item. > > That's exactly what I'm trying to do, simulate

Re: menuitem activate

2007-05-23 Thread danielg RHCE
On Wed, 23 May 2007 16:18:41 +0200, Enrico Tröger wrote > On Wed, 23 May 2007 10:12:31 -0400, "danielg RHCE" <[EMAIL PROTECTED]> > wrote: > > > Legacy code I'm trying to update and I've been out of the programming > > thing for a while. > > > > I have a popup menu with this item in it: > >

Re: menuitem activate

2007-05-23 Thread Enrico Tröger
On Wed, 23 May 2007 10:12:31 -0400, "danielg RHCE" <[EMAIL PROTECTED]> wrote: > Legacy code I'm trying to update and I've been out of the programming > thing for a while. > > I have a popup menu with this item in it: > menuitem = gtk_item_factory_get_item (ifactory, "/Refresh > Tree"); gtk_