index
gtk-- homepage



Description:
Gtk_Menu

#include <gtk--/menu.h>
Base classes: Gtk_MenuShell



Properties:

NameTypeGetSetDescription
parent_menu_item Gtk_Widget* none popup()  
accel_group GtkAccelGroup*   set_accel_group()  
position_func GtkMenuPositionFunc none popup() A function taking a GtkMenu* (NOTE! NOT a Gtk_Menu!), pointers to x and y gint coordinates and a pointer to some user data. The function should set x and y to where the menu will be positioned on the screen
position_func_data gpointer none popup() user data which will be passed to position_func
torn_off bool none set_tearoff_state() Whether the menu is torn off (detached) or not.


Public member index:


Gtk_Menu();
Gtk_Menu(GtkMenu *castitem);
void append(const Gtk_MenuItem &child);
append a menu item

void prepend(const Gtk_MenuItem &child);
insert a menu item in first position

void insert(const Gtk_MenuItem &child,gint position);
insert a menu item at specified position

void append(const Gtk_ObjectHandle <Gtk_MenuItem > &child);
void prepend(const Gtk_ObjectHandle <Gtk_MenuItem > &child);
void insert(const Gtk_ObjectHandle <Gtk_MenuItem > &child,gint position);
void popup(const Gtk_MenuShell &parent_menu_shell,const Gtk_MenuItem &parent_menu_item,GtkMenuPositionFunc func,gpointer data,gint button,guint32 activate_time);
Display the menu on screen

void popup(GtkMenuPositionFunc func,gpointer data,gint button,guint32 activate_time);
void popdown();
Hides the menu away

const Gtk_Widget *get_active()const;
Gtk_Widget *get_active();
void set_active(gint index);
void reposition();
void set_accel_group(const Gtk_AccelGroup &accel_group);
void set_tearoff_state(bool torn_off);
void set_title(const _gtk_string &title);
void attach_to_widget(const Gtk_Widget &widget,GtkMenuDetachFunc detacher);
const Gtk_Widget *get_attach_widget()const;
Gtk_Widget *get_attach_widget();
void detach();
GtkMenu *gtkobj();
const GtkMenu *gtkobj()const;
static bool isGtkMenu(Gtk_Object *checkcast);
Protected member index:


virtual void *get_parent_class();
Private member index:


GtkType get_type();
const Gtk_Widget *_get_active()const;

Public member details:


append
void Gtk_Menu::append(const Gtk_ObjectHandle <Gtk_MenuItem > &child);

same, except that the item will be "owned" by the menu widget. That is, the widget will destroy it along when it is deleted


get_active
const Gtk_Widget *Gtk_Menu::get_active()const;

Keep track of the last menu item selected, for the purposes of the option menu


reposition
void Gtk_Menu::reposition();

Position the menu according to it's position function. This wraps a function called by gtkmenuitem.c when a menu-item changes its allocation. You most likely don't need to care about it.


set_title
void Gtk_Menu::set_title(const _gtk_string &title);

Sets the window manager title for the window that appears when a menu is torn off


attach_to_widget
void Gtk_Menu::attach_to_widget(const Gtk_Widget &widget,GtkMenuDetachFunc detacher);

Attach the menu to a widget. detacher is a function which takes the attached GtkWidget* and GtkMenu* (NOTE! NOT the Gtk_Widget and Gtk_Menu!) This is mostly used by other widgets like Gtk_MenuItem or Gtk_NoteBook. You probably don't need to care about it.


detach
void Gtk_Menu::detach();

Detach the menu from the widget it was attached to (calls the passed detacher function)


Protected member details:



Private member details:



Examples:





(pages generated by PERCEPS -script.)