On Wed, Jul 2, 2008 at 10:32 PM, Casey McGinty <[EMAIL PROTECTED]> wrote:
> On Tue, Jul 1, 2008 at 11:23 AM, Chris Cole <[EMAIL PROTECTED]> wrote: > >> Hey all, >> I have a simple combobox that i've created with glade. I was just >> wondering if i could set the sensitivity of the individual elements in >> the combobox? like setting a widget set_sensitive(False) ? > > > I think you can set the 'sensitive' property of the CellRendererText > instance stored in the the ComboBox instance. I believe you can use the > get_cells() method to access the instance. However, I'm not sure if there is > a dedicated CellRendereText instance for each row. Let me know if that helps > as I'm still trying to learn as well. > > - Casey > Following up, I think you have to add a boolean 'sensitive' column to the gtk.ListStore model of the gkt.ComboBox. Then associate the 'sensitive' column with the 'sensitive' property of the CellRenderText instance using the 'add_attribute' method. For example: # assuming combo box model has a text value (col 0) and boo sensitive value (col 1) combo_box.add_attribute( cell, 'sensitive', 1 ) You can get more info about associating cell render attribute here: http://www.pygtk.org/pygtk2tutorial/sec-CellRenderers.html#sec-CellRendererAttributes - Casey
_______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
