omtk - a platform independent GUI toolkit

Documentation

 

MenuItem

Events

OMTK_EVENT_DID_CLICK

#define OMTK_EVENT_DID_CLICK

This event is called when you activate a menu item. You shouldn't use this event on menu items with a submenu.

Functions

omtk_menuitem_create()

OmtkWidget *omtk_menuitem_create(char *label);

Returns a new menu item with a label.

omtk_menuitem_submenu_set()

void omtk_menuitem_submenu_set(OmtkWidget *item, OmtkWidget *menu);

Sets the submenu of item to menu. If menu is NULL, the submenu of item will be removed.

Note: You may not change the submenu of a top-level menu item (which is e.g. "File", "Edit", etc. in a typical menubar).

omtk_menuitem_submenu_get()

OmtkWidget *omtk_menuitem_submenu_get(OmtkWidget *item);

Returns the submenu which was set with omtk_menuitem_submenu_set(). Returns NULL, if the item has no submenu.

omtk_menuitem_label_set()

void omtk_menuitem_label_set(OmtkWidget *item, char *label);

Sets the label of a menu item to label.

omtk_menuitem_label_get()

char *omtk_menuitem_label_get(OmtkWidget *item);

Returns the label of a menu item.

omtk_menuitem_shortcut_set()

void omtk_menuitem_shortcut_set(OmtkWidget *item, unsigned short modifier, \
unsigned short key);

Sets the shortcut of the menu item. See OMTK_KEY_* for the modifier and the key.

You can combine the modifier keys, e.g.:

omtk_menuitem_shortcut_set(item_file_save_as, OMTK_KEY_CTRL | OMTK_KEY_SHIFT, OMTK_KEY_S);

omtk_menuitem_free()

void omtk_menuitem_free(OmtkWidget *widget);

Frees the menu item. Do not call this function directly.



Zurück zu www.eggdrop.ch | Back to www.eggdrop.ch

Last update: 20.02.04

Copyright (C) 2004, 2005 by Thomas "tom" Steinacher <tom at eggdrop.ch>

SourceForge.net Logo Valid HTML 4.0!