Re: [pygtk] I must be missing something - can't get label of a menu item

2004-11-21 Thread Skip Montanaro
Christian> One alternative which I use daily is, instead of relying on Christian> the label, doing a set_data() on the menuitems as you put Christian> them into the menu, and then using get_data() to grab it Christian> back. I suppose I can figure it out, but is that an option from

Re: [pygtk] I must be missing something - can't get label of a menu item

2004-10-19 Thread Christian Robottom Reis
On Tue, Oct 19, 2004 at 10:54:21AM +0100, Gustavo J. A. M. Carneiro wrote: > And a shared data structure is good. You can even use that to build > the option menu. And you'll have anyways most of the times if you value > gui / main code separation in your program. For the record: IMO not neces

Re: [pygtk] I must be missing something - can't get label of a menu item

2004-10-19 Thread Gustavo J. A. M. Carneiro
Seg, 2004-10-18 às 15:44 -0300, Christian Robottom Reis escreveu: > On Mon, Oct 18, 2004 at 07:15:32PM +0100, Gustavo J. A. M. Carneiro wrote: > > It's just that you have to get the selected menu item first, only then > > get_data. It forces you to understand the internal structure of the > > op

Re: [pygtk] I must be missing something - can't get label of a menu item

2004-10-18 Thread Christian Robottom Reis
On Fri, Oct 15, 2004 at 11:04:39PM +0100, Gustavo J. A. M. Carneiro wrote: > > Johan's suggested the FAQ, and that's full of warnings that should be > > heeded. One alternative which I use daily is, instead of relying on the > > label, doing a set_data() on the menuitems as you put them into the >

Re: [pygtk] I must be missing something - can't get label of a menu item

2004-10-18 Thread Christian Robottom Reis
On Mon, Oct 18, 2004 at 07:15:32PM +0100, Gustavo J. A. M. Carneiro wrote: > It's just that you have to get the selected menu item first, only then > get_data. It forces you to understand the internal structure of the > option menu to get to the selected menu item. Well, isn't it just a matte

Re: [pygtk] I must be missing something - can't get label of a menu item

2004-10-18 Thread Gustavo J. A. M. Carneiro
Seg, 2004-10-18 às 14:55 -0300, Christian Robottom Reis escreveu: > On Fri, Oct 15, 2004 at 11:04:39PM +0100, Gustavo J. A. M. Carneiro wrote: > > > Johan's suggested the FAQ, and that's full of warnings that should be > > > heeded. One alternative which I use daily is, instead of relying on the >

Re: [pygtk] I must be missing something - can't get label of a menu item

2004-10-18 Thread Christian Robottom Reis
On Fri, Oct 15, 2004 at 09:51:49PM -0500, Skip Montanaro wrote: > Christian> One alternative which I use daily is, instead of relying on > Christian> the label, doing a set_data() on the menuitems as you put > Christian> them into the menu, and then using get_data() to grab it > Chr

Re: [pygtk] I must be missing something - can't get label of a menu item

2004-10-15 Thread Gustavo J. A. M. Carneiro
Sex, 2004-10-15 às 15:20 -0300, Christian Robottom Reis escreveu: > On Thu, Oct 14, 2004 at 04:24:17PM -0500, Skip Montanaro wrote: > > I have an option menu full of radio menu items defined via Glade. At > > runtime I'd like to get a string value out of the menu which > > corresponds to the selec

Re: [pygtk] I must be missing something - can't get label of a menu item

2004-10-15 Thread Christian Robottom Reis
On Thu, Oct 14, 2004 at 04:24:17PM -0500, Skip Montanaro wrote: > I have an option menu full of radio menu items defined via Glade. At > runtime I'd like to get a string value out of the menu which > corresponds to the selected item. The displayed label would be fine > (I'll force it to be unique

Re: [pygtk] I must be missing something - can't get label of a menu item

2004-10-15 Thread Skip Montanaro
>> I can then march through that [optionmenu] to find the active item, >> but can't find a label property or something similar from which I can >> extract the text. Johan> That's FAQ 16.6: Johan> http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq16.006.htp Joh

Re: [pygtk] I must be missing something - can't get label of a menu item

2004-10-14 Thread Johan Dahlin
> I did get a handle on one item from which I called get_group() to get all > the items in the group. I can then march through that to find the active > item, but can't find a label property or something similar from which I can > extract the text. I've tried item.get_children(), item.get_child()

[pygtk] I must be missing something - can't get label of a menu item

2004-10-14 Thread Skip Montanaro
I have an option menu full of radio menu items defined via Glade. At runtime I'd like to get a string value out of the menu which corresponds to the selected item. The displayed label would be fine (I'll force it to be unique) but I can't figure out how to get at it. I'm trying to avoid enumera