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 > > > label, doing a set_data() on the menuitems as you put them into the > > > menu, and then using get_data() to grab it back. I can get example code > > > if that's not clear enough. > > > > > > There's one catch -- you can't use None given get_data() returns None by > > > default; just use a ValueUnset dummy class to work around that, though. > > > > Actually, I think the only clean solution is to use > > gtk.OptionMenu.get_history(), as index to a list of strings, or whatever > > you want associated with each option. > > Hmmm. What's wrong with the get_data() approach I outlined? It frees you > from using strings and shared data structures, at least.
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. get_history is more straightforward, and you don't have to know anything about menus or menu items. Anyway, this discussion is irrelevant, since the widget is deprecated. :-) > > Take care, > -- > Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331 -- Gustavo J. A. M. Carneiro <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> The universe is always one step beyond logic.
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
