On Wed, Jan 14, 2004 at 12:33:43PM -0600, Mauricio T�llez wrote:
> Hi all, I want to use a combo like a html combo. I mean, I want to
> attach a number to the selected string. For example, if a fill the combo
> with data from a employee records like:
> 1, John Doe
> 2, Duffy Duck
> 3, Micky Mouse
> 
> I want that the combo display the names, but if I do
> mycombo.entry.get_text() I want the number, maybe there is another
> function that get_text that do the trick, but I don't know. Thanks in
> advance.

There isn't an easy way to do this currently, AFAIK. There's a new
multiple selection widget in 2.4, I think, but if you want to do this
with the Combo, you'll need to do it manually: associate a dictionary
with the widget, and look up the corresponding value with the currently
selected key. It's not rocket science, but it's not very clean, either.

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 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