Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

Inti::Gtk::OptionMenu Class Reference

A GtkOptionMenu C++ wrapper class. More...

#include <inti/gtk/optionmenu.h>

Inheritance diagram for Inti::Gtk::OptionMenu:

Inti::Gtk::Button Inti::Gtk::Bin Inti::Gtk::Container Inti::Gtk::Widget Inti::Gtk::Object Inti::Atk::Implementor Inti::G::Object Inti::G::TypeInterface Inti::G::TypeInstance Inti::MemoryHandler Inti::G::TypeInstance Inti::ReferencedBase Inti::ReferencedBase List of all members.

Public Member Functions

Constructors
Accessors
Methods
Property Proxies
Signal Proxies

Protected Member Functions

Constructors
Signal Handlers

Detailed Description

A GtkOptionMenu C++ wrapper class.

OptionMenu is a widget that allows the user to choose from a list of valid choices. The OptionMenu displays the selected choice. When activated the OptionMenu displays a popup Menu which allows the user to make a new choice.

Using a OptionMenu is simple; construct a Menu, then append menu items to it with Gtk::MenuShell::append(). Set that menu on the option menu with set_menu(). Set the selected menu item with set_history(); connect to the "changed" signal on the option menu; in the "changed" signal, check the new selected menu item with get_history().


Constructor & Destructor Documentation

Inti::Gtk::OptionMenu::OptionMenu GtkOptionMenu *  option_menu,
bool  reference = false
[explicit, protected]
 

Construct a new OptionMenu from an existing GtkOptionMenu.

Parameters:
option_menu A pointer to a GtkOptionMenu.
reference Set false if the initial reference count is floating, set true if it's not.

The option_menu can be a newly created GtkOptionMenu or an existing GtkOptionMenu (see G::Object::Object).

Inti::Gtk::OptionMenu::OptionMenu Menu menu,
unsigned int  index = 0
[explicit]
 

Construct a new option menu with a menu that is popped up to allow the user to choose a new value.

Parameters:
menu The Menu to associate with the option menu.
index The index of the menu item to select; index values are from 0 to n-1.


Member Function Documentation

int Inti::Gtk::OptionMenu::get_history  )  const
 

Retrieves the index of the currently selected menu item.

Returns:
The index of the selected menu item, or -1 if there are no menu items.

The menu items are numbered from top to bottom, starting with 0.

virtual void Inti::Gtk::OptionMenu::on_changed  )  [protected, virtual]
 

Called when the selected menu item changes.

Call get_history() to get the index of the selected menu item.

void Inti::Gtk::OptionMenu::set_history unsigned int  index  ) 
 

Selects the menu item specified by index making it the newly selected value for the option menu.

Parameters:
index The index of the menu item to select; index values are from 0 to n-1.

void Inti::Gtk::OptionMenu::set_menu Menu menu  ) 
 

Sets the Menu that is popped up to allow the user to choose a new value.

Parameters:
menu The Menu to associate with the option menu.

You should provide a simple menu avoiding the use of tearoff menu items, submenus, and accelerators.

const ChangedSignalProxy Inti::Gtk::OptionMenu::sig_changed  )  [inline]
 

Connect to the changed_signal; emitted when the selected menu item changes.

Call get_history() to get the index of the selected menu item.


The documentation for this class was generated from the following file: Main Page - Footer


Generated on Sun Sep 14 20:08:17 2003 for Inti by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002