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.

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to