The OpenNET Project
 
Поиск (ключи):    ПРОГРАММЫ СТАТЬИ СОВЕТЫ ФОРУМ
  WIKI НОВОСТИ (+) MAN'ы ДОКУМЕНТАЦИЯ

Каталог документации / Раздел "Perl" / Оглавление документа

Chapter 27. Option Menu

Inheritance Hierarchy

Object
   +--- Widget
         +--- Container
               +--- Bin
                     +--- Button
                           +--- OptionMenu
         

An OptionMenu is a widget that allows the user to select from a valid set of choices. The current choice is shown in the OptionMenu, and if the user clicks on the OptionMenu, it displays a popup menu consisting of all the valid choices.

This simple widget is creating using:

$option = new Gtk::OptionMenu();

To add a menu, create a new popup menu, as described in the section on the menu widget , without any tearoffs, submenus, or accelerators, and add it to the OptionMenu using:

$option->set_menu( $popup_menu );

As you might suspect, you can retrieve the menu associated with an OptionMenu using:

$popup_menu = $option->get_menu();

If you want to remove a menu from an OptionMenu, you may do so with:

$option->remove_menu();

Finally, if you want to select an item in the menu, you would use:

$option->set_history( $index );

where $index is the index of the menu item to select. The index value ranges from 0 (first item) to n-1, where n is the number of items in the menu.


ПОДПИШИСЬ НА ЖУРНАЛ Linux Format 2012!

Журнал "Linux Format" (Линукс Формат)- Единственный в России и странах СНГ журнал на русском языке, посвящённый Linux и свободному ПО. Журнал для IT-директоров, IT-менеджеров, программистов, системных администраторов, учителей школ и преподавателей ВУЗов и всех пользователей ПК. В каждом выпуске: Новости индустрии OpenSource, обзоры новинок свободного ПО, обучающие и методические статьи.

Каждый, кто оформит подписку, получает бонусы и подарки- объёмные наклейки на системный блок, диск с архивом номеров за 2005-2011 г.г. и ежемесячно электронную версию журнала в pdf-формате.

Оформить подписку на год


  Закладки на сайте
  Проследить за страницей
Created 1996-2012 by Maxim Chirkov  
ДобавитьРекламаВебмастеруГИД  
RUNNet TopList