Next: , Previous: , Up: GUI Development   [Contents][Index]


35.4 GUI Utility Functions

These functions do not implement a GUI element but are useful when developing programs that do. The functions uiwait, uiresume, and waitfor are only available with the qt or fltk toolkits.

: data = guidata (h)
: guidata (h, data)

Query or set user-custom GUI data.

The GUI data is stored in the figure handle h. If h is not a figure handle then it’s parent figure will be used for storage.

data must be a single object which means it is usually preferable for it to be a data container such as a cell array or struct so that additional data items can be added easily.

See also: getappdata, setappdata, get, set, getpref, setpref.

: hdata = guihandles (h)
: hdata = guihandles

Return a structure of object handles for the figure associated with handle h.

If no handle is specified the current figure returned by gcf is used.

The fieldname for each entry of hdata is taken from the "tag" property of the graphic object. If the tag is empty then the handle is not returned. If there are multiple graphic objects with the same tag then the entry in hdata will be a vector of handles. guihandles includes all possible handles, including those for which "HandleVisibility" is "off".

See also: guidata, findobj, findall, allchild.

: have_window_system ()

Return true if a window system is available (X11, Windows, or Apple OS X) and false otherwise.

See also: isguirunning.

: isguirunning ()

Return true if Octave is running in GUI mode and false otherwise.

See also: have_window_system.

: movegui
: movegui (h)
: movegui (pos)
: movegui (h, pos)
: movegui (h, event)
: movegui (h, event, pos)

Move a figure specified by figure handle h to a position on the screen defined by pos.

h is a figure handle, or a handle to a graphics object. In the latter case, its parent figure will be used. If unspecified, h will be set to the handle of the relevant figure if a callback is being executed (gcbf), otherwise it will be set to the handle of the current figure (gcf).

pos is either a two-value numeric vector or a string. If pos is numeric then it must be of the form [h, v] specifying the horizontal and vertical offsets of the figure with respect to the screen. A positive value indicates the offset between the left (or bottom for the vertical component) of the screen, and the left (or bottom) of the figure. A negative value indicates the offset between the right (or top) of the screen and the right (or top) of the figure.

Possible values for pos as a string are

north

Top center of the screen.

south

Bottom center of the screen.

east

Right center of the screen.

west

Left center of the screen.

northeast

Top right of the screen.

northwest

Top left of the screen.

southeast

Bottom right of the screen.

southwest

Bottom left of the screen.

center

Center of the screen.

onscreen (default)

The figure will be minimally moved to be entirely visible on the screen, with a 30 pixel extra padding from the sides of the screen. This is the default value if none is provided.

event contains event data that will be ignored. This construct facilitates a call to movegui from a callback.

: openvar (name)

Open the variable name in the graphical Variable Editor.

: uiwait
: uiwait (h)
: uiwa