Description
GnomeMDIChild is an abstract class for GnomeMDI
children. In order to use it, you have to either derive a new class from it
and set the proper virtual functions in its parent
GnomeMDIChildClass structure or use the
MDIGenericChild that allows to specify the relevant functions on a
per-instance rather than on per-class basis.
Each instance of GnomeMDIChild class defines a name for the child and
possibly a menu template for document-specific menus that will be merged with
the global MDI menus.
The GnomeMDIChild class defines four virtual functions
that may be used by the MDI: create_view should be defined for each subclass
and should return a pointer to a GtkWidget representing a new view of the
document. create_menus should return a GList of menu items and can be used
instead of the menu template. get_config_string should return a string that
represents the state of the child and will be used in automatic session
saving and restoring. The last virtual function, set_label, should return
a pointer to a GtkWidget that will be used as notebook and menu item label
for this child. GnomeMDIChild class provides the default
implementation of set_label while create_view function must be defined for
each subclass; create_menus and get_config_string may be left undefined.
Details
GnomeMDIChildViewCreator ()
GtkWidget* (*GnomeMDIChildViewCreator) (GnomeMDIChild*,
gpointer); |
GnomeMDIChildMenuCreator ()
GList* (*GnomeMDIChildMenuCreator) (GnomeMDIChild*,
GtkWidget*,
gpointer); |
GnomeMDIChildConfigFunc ()
GnomeMDIChildLabelFunc ()
GtkWidget* (*GnomeMDIChildLabelFunc) (GnomeMDIChild*,
GtkWidget*,
gpointer); |
gnome_mdi_child_add_view ()
Creates a new view of a child (a GtkWidget) adds it to the list
of the views and returns a pointer to it. Virtual function
that has to be specified for classes derived from GnomeMDIChild
is used to create the new view.
gnome_mdi_child_remove_view ()
void gnome_mdi_child_remove_view (GnomeMDIChild *mdi_child,
GtkWidget *view); |
Removes view view from the list of mdi_child's views and
unrefs it.
gnome_mdi_child_set_name ()
void gnome_mdi_child_set_name (GnomeMDIChild *mdi_child,
gchar *name); |
Changes name of mdi_child to name. name is duplicated and stored
in mdi_child. If mdi_child has already been added to GnomeMDI,
it also takes care of updating it.
gnome_mdi_child_set_menu_template ()
Sets the template for menus that are added and removed when differrent
children get activated. This way, each child can modify the MDI menubar
to suit its needs. If no template is set, the create_menus virtual
function will be used for creating these menus (it has to return a
GList of menu items). If no such function is specified, the menubar will
be unchanged by MDI children.