On Wed, Dec 03, 2003 at 07:06:54PM +0100, Fernando San Mart�n W. wrote:
> How can get the strings that i set using gtk.set_popdown_strings()
> method in a gtk.Combo?

I don't think it's actually supposed to be done; if you look at the code
for set_popdown_strings, it creates list items that contain the labels
stuffed with the strings in question. You *could* iterate through
combo.list.children() and then grab the label, which should be the first
element of the list item itself (.children()[0]). This is an O(n)
operation, however.

However, you have a much simpler alternative: just store the strings
yourself, locally.

    def set_combo_strings(self, s):
        self.strings = s
        self.combo.set_popdown_strings(s)

You have self.strings conveniently stored in a python list, and you can
get them back whenever you like, at O(1).

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