[pygtk] liststore (ComboBoxEntry) alignment (justify)
John Finlay
finlay at moeraki.com
Thu Apr 24 02:27:23 WST 2008
Andrea Caminiti wrote:
> ----- Original Message ----
> From: Andrea Caminiti <a.caminiti at yahoo.com>
> To: John Finlay <finlay at moeraki.com>
> Sent: Wednesday, April 23, 2008 9:16:24 AM
> Subject: Re: [pygtk] liststore (ComboBoxEntry) alignment (justify)
>
>
>
>
>> Andrea Caminiti wrote:
>>
>>> hi john:
>>>
>>> i was trying to use the code you just posted to to have a combobox with images and it's labels (text), only, no text entry needed. but i got some warnings.
>>>
>>> the code i used:
>>>
>>> def combo(self):
>>> #lists = self.list
>>> combobox = gtk.ComboBox()
>>> list = gtk.ListStore(gtk.gdk.Pixbuf, str)
>>> px = gtk.CellRendererPixbuf()
>>> text = gtk.CellRendererText()
>>> combobox.pack_start(px, True)
>>> combobox.pack_start(text, True)
>>> combobox.add_attribute(px, "pixbuf", 0)
>>> combobox.add_attribute(text, "text", 1)
>>> combobox.pack_end(text, True)
>>>
>>>
>> you seem to be adding this twice. I think that's what the error message
>>
> is about.
>
>
You are adding the cellrenderertext "text" to the combobox twice - once
in the pack_start and once in the pack_end. You can only add it once.
Remove the line containing pack_end.
John
More information about the pygtk
mailing list