Re: GtkTreeStore in a ComboBox



On Fri, 2005-07-08 at 20:58 -0500, David wrote:
I'm trying to get a TreeStore in a ComboBox to look like I want but
haven't been able to do so.

I'm trying to design a form to be used with a database of business
records.

I have categories under "Income" and "Expense", which I wish to be
separated from each other.  I can get the setup I want by creating a
TreeStore with 'Income' and 'Expense' as top-level rows and each
category under the respective top-level.  When I click on the ComboBox,
I get a pop-up menu with "Income" and "Expense" displayed (separated by
a separator) - this is well and good.  But when I come to the submenus,
I have the top-level name, i.e. "Income" or "Expense" displayed, under
it a separator, and then the categories.  I'd prefer that the top-levels
were not displayed in the sub-menu, or at least were not clickable.  But
I've not been able to find a solution.

I'll attach a simple test program with which I've been experimenting.
It's written in Perl - I contemplated sending it to the gtk-perl list,
but I think my question is more of a gtk question.

If anyone can point me in the right direction - or tell me a better way
- I'd greatly appreciate it.

Make the toplevel item non-selectable/insensitive. They are only
repeated in the submenus because the combo box thinks you want to allow
them to be selected, and menu items with submenus can not be directly
activated in the gtk menu system.

Matthias




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