GtkToolbar::insert_element

GtkToolbar::insert_element

GtkWidget insert_element(GtkToolbarChildType widget_type, GtkWidget widget, string button_text, string tooltip_text, string tooltip_private_text, GtkWidget icon, int position, string callback, [mixed userparam]);

Inserts a new toolbar element at the given position. This is the base function for all other insert/append/prepend functions.

The widget_type determines which type of widget shall be inserted/created. widget has to be set if widget_type is set to GTK_TOOLBAR_CHILD_WIDGET. All other types require a null as widget because they are created by the function.

button_text specifies the text ("label") to be visible on the button, tooltip_text is the tooltip text which will be visible when the user hovers the button for a specific time. tooltip_private_text is the text being visible using a GtkTipsQuery. See GtkTooltips for more details on this topic.

icon is a widget, preferably a GtkPixmap which shall be used as an icon. The icon is used when the GtkToolbarStyle is set to icon or both (only with widgets created by insert_element). You can use every type of widget, but take care that the toolbar button can be identified by it when the style is icon only. If the icon is set to null, the text will still be visible.

The position parameter can be in the range from 0 (insert as first element) to the number of widgets (append after the last) being on the toolbar. This can be determined by doing a count( $toolbar->children()), but just an append_element() should be more easy.

Last parameter is callback, the function to be called when the widget is clicked. You can pass a number of self-defined extra parameters to the callback function by appending them after the callback parameter.

© Copyright 2003-2023 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.