SLgtk provides an assortment of other higher-level S-Lang functions and variables, to simplify common case use of selected Gtk widgets or features. The names of some of these are prefixed with underscores, usually to distinguish them from wrappers for Gtk functions proper or denote their higher susceptibility to revision in a future release.
As a convenience SLgtk pre-allocates a number of GdkColor structures, for colors expected to be commonly used. They are named
gtk.slhas been loaded.
A convenience function to instantiate a GtkMenu, whose entries are labels created from the given array of strings. The callback specification may either be
GtkWidget = _menu_new(String_Type labels, callback [,cbdata1, cbdata2, ...] )
NULLor a signature (a function reference, optionally followed by one or more callback data parameters) suitable for responding to the activate signal via
g_signal_connect(). Recall that such callback functions should accept at least one argument, even when no callback data is registered, to receive the activated menu item. Any label which, after being lowercased, matches "<separator>" will cause a horizontal separator to be drawn in the menu.
A convenience function to instantiate a GtkOptionMenu, whose entries are labels created from the given array of strings. The active menu item will be set to the given default.
GtkWidget = _option_menu_new(String_Type labels, Integer_type default)
This function returns an instantiated GtkButton, which when realized will display a swatch of the given color. When the button is pressed a color selection dialog will be launched through which the color of the swatch (as well as the RGB field values within the given GdkColor structure, since S-Lang structures are passed as references) may be modified.
GtkWidget = _color_button_new(GdkColor_structure)
This function will create a non-modal dialog to display the given text in a window with the given title. The dialog will be raised immediately, provided there is at least one active
This function will return a one if the given datum can be interpreted as a real- or integral-valued numerical type, and zero otherwise. This function will be phased out of SLgtk proper, as it is now available in S-Lang 2.x.
Integer_Type = _is_numeric(Any_Type datum)
This function returns either 1 or 0, to indicate whether the given datum can be dereferenced to invoke a function. This function will be phased out of SLgtk proper, as it is now available in S-Lang 2.x.
Integer_Type = _is_callable(Any_Type datum)
This function will search the SLgtk documentation for the given topic. If the topic is found then its entire entry will be returned as a single string, otherwise an error string will be returned.
String_Type = _get_slgtk_doc_string(topic)
Provides a one-step way to set the transient parent of a window AND have it be destroyed with that parent. It is equivalent to calling
Similar to the Gdk function
Array_Type = _gdk_pixbuf_get_formats()
gdk_pixbuf_get_formats(), in that its return value indicates the number and kind of file formats supported by the Gdk pixbuf interface, only this version returns an array of
String_Typeinstead of a