[pygtk] liststore (ComboBoxEntry) alignment (justify)

Andrea Caminiti a.caminiti at yahoo.com
Thu Apr 24 03:02:02 WST 2008


Thanks a lot, now it's ok, 0 warnings!

----- Original Message ----
From: John Finlay <finlay at moeraki.com>
To: Andrea Caminiti <a.caminiti at yahoo.com>
Cc: pygtk at daa.com.au
Sent: Wednesday, April 23, 2008 1:27:23 PM
Subject: Re: [pygtk] liststore (ComboBoxEntry) alignment (justify)

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





      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ



More information about the pygtk mailing list