| ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot |
GtkItemFactory::create_itemsYou usually create your menu by calling this method with an array full of menu item definitions. Such a item definition is an array itself and has the following structure: String path, String accelerator, Mixed callback, int callback_action, String type The function can be called several times, causing the new items to be appended to the existing ones. If you add a first-level menu item on a second create_items call,
an existing <LastBranch> will lose its right alignment.
The path is the name describing the path form the top
down to this item. The levels are separated with a slash /,
and underscores _ can be used to create in-menu accelerators.
The accelerator sets the shortcut for the menu item; it can be NULL or a combination of modifiers and chars. As usually, the callback accepts the String of the function to call, or an array with the reference to an object as first, and the name of the object's function as the second parameter. This parameter can be NULL. Unlike many other callback registering functions, this one doesn't support own parameters as callback_option. Instead, you can give a number (int) only to describe the function of the menu item. So you can use 1 for opening and 2 for saving to distinguish both when they use the same callback. The callback function needs to implement 2 parameters:int callback_option, GtkMenuItem item. The parameter has to be of type int, so a NULL cause an error. The type is a string from this list: 表 5. GtkItemFactory item types
例 19. Extensive GtkItemFactory::create_items example
|
各種マニュアル:
PHPマニュアル |
PEARマニュアル |
Smarty(英語)マニュアル |
PHP-GTKマニュアル |
「GtkItemFactory::create_items」をGoogle検索
|