[Glade-users] combobox question



On Thu, Sep 23, 2010 at 5:08 PM, Arthur Shats <ashats at hotmail.com> wrote:
I am using Glade-2 and Python (new to Python).
On the widow created in Glade, I have a combobox with 3 items filled?in
Glade. Under certain conditon in my code, one of the items in the
combobox?does not appy, so?I need make that one?item insensitive
(unselectable) or preferably hide it all together.?How would I accomplish
this if possible?

Use gtk.TreeModelFilter as the model for your combo box, and do one of
the following as appropriate:

1. Add an extra boolean column to the underlying model, and set the
visible column of the filter accordingly. The value of this column
(true/false) will be used to determine which rows are to be displayed.
http://library.gnome.org/devel/pygtk/stable/class-gtktreemodelfilter.html#method-gtktreemodelfilter--set-visible-column

Or

2. Create a new function, the return value of which (true/false) will
decide whether or not to display a given row, and set this as the
visible func in the filter
http://library.gnome.org/devel/pygtk/stable/class-gtktreemodelfilter.html#method-gtktreemodelfilter--set-visible-func




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]