[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk-app-devel
Subject:    Re: Help with GtkOptionMenu
From:       Brett Johnson <brett_johnson () hp ! com>
Date:       1999-07-30 23:05:22
[Download RAW message or body]

Oliver Freyd wrote:
> 
> On 28 Jul, Brett Johnson wrote:
> >
> > gint
> > option_menu_get_history(GtkWidget *omenu)
> > {
> >     GtkWidget *menu, *menu_item;
> >     GList *children, *child;
> >
> >     if (omenu) {
> >         menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(omenu));
> >         menu_item = GTK_OPTION_MENU(omenu)->menu_item;
> >         if (menu) {
> >             children = GTK_MENU_SHELL(menu)->children;
> >             child = g_list_find(children, menu_item);
> >             if (child) {
> >                 return g_list_position(children, child);
> >             }
> >         }
> >     }
> >
> >     return -1;
> > }
> >
> > Cheers!
> 
> Hello Brett,
> 
> this was quite helpful for me, too, I used to find the selected item be
> using a callback with different data passed by different items, but
> this is more elegant. I think it should actually be added to the gtk+
> source, if only for symmetry.  There's a option_menu_set_history, so
> option_menu_get_history seems logical!
> 
> So this should go into gtk!

I'm all for that, assuming that this is a reasonable solution.  All I
know is that it happens to work for what I'm using it for.  I don't know
if it will work under all conditions (i.e. I don't know if "menu_item" is
always current, or if the selected item is always contained in the
"children" list).  Anyway, I'm pretty new to gtk (in fact, I'm pretty new
to the whole open source thing :), how does one go about submitting code
to be included in the "blessed" gtk CVS repository?

Cheers!
["brett_johnson.vcf" (text/x-vcard)]
-- 
         To unsubscribe: mail gtk-app-devel-list-request@redhat.com with 
                       "unsubscribe" as the Subject.

	Mailing list concerns should be mailed to <listmaster@redhat.com>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic