Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I find out which is the selected item in a GtkOptionMenu?

GtkOptionMenu Selected
0
10 Posted

How do I find out which is the selected item in a GtkOptionMenu?

0

The optionmenu is an evil widget, make no mistake. By using it you will see the `magic’ it uses to appear to be a simple listbox (make no mistake!) Note these important, err, `aspects’ of it: • The OptionMenu is a container that holds a label, and that responds to clicks by presenting a menu. It is NOT a menu! • The OptionMenu’s `menu’ property gives access to its menu – it may be None when there is no menu associated (in that case, you can create a new GtkMenu and use optionmenu.set_menu(menu)). The menu is a regular menu and contains GtkMenuItems. • The selected GtkMenuItem contains no label – its label is reparented to the GtkOptionMenu itself. The label (or nothing) will be the only child the optionmenu has.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123