Module Toolbox

module Toolbox: sig .. end
GUI Toolbox.

This module implements GUI helpers upon LablGtk. It uses nothing from Gtk_helper but the UTF-8 conversion facilities.



Concepts


class type widget = object .. end
class ['a] signal : object .. end
class ['a] selector : 'a -> object .. end

Icons


type icon = [ `ABOUT
| `ADD
| `APPLY
| `BOLD
| `CANCEL
| `CDROM
| `CLEAR
| `CLOSE
| `COLOR_PICKER
| `CONNECT
| `CONVERT
| `COPY
| `CUT
| `DELETE
| `DIALOG_AUTHENTICATION
| `DIALOG_ERROR
| `DIALOG_INFO
| `DIALOG_QUESTION
| `DIALOG_WARNING
| `DIRECTORY
| `DISCONNECT
| `DND
| `DND_MULTIPLE
| `EDIT
| `EXECUTE
| `FILE
| `FIND
| `FIND_AND_REPLACE
| `FLOPPY
| `FULLSCREEN
| `GOTO_BOTTOM
| `GOTO_FIRST
| `GOTO_LAST
| `GOTO_TOP
| `GO_BACK
| `GO_DOWN
| `GO_FORWARD
| `GO_UP
| `HARDDISK
| `HELP
| `HOME
| `INDENT
| `INDEX
| `INFO
| `ITALIC
| `JUMP_TO
| `JUSTIFY_CENTER
| `JUSTIFY_FILL
| `JUSTIFY_LEFT
| `JUSTIFY_RIGHT
| `LEAVE_FULLSCREEN
| `MEDIA_FORWARD
| `MEDIA_NEXT
| `MEDIA_PAUSE
| `MEDIA_PLAY
| `MEDIA_PREVIOUS
| `MEDIA_RECORD
| `MEDIA_REWIND
| `MEDIA_STOP
| `MISSING_IMAGE
| `NETWORK
| `NEW
| `NO
| `OK
| `OPEN
| `ORIENTATION_LANDSCAPE
| `ORIENTATION_PORTRAIT
| `ORIENTATION_REVERSE_LANDSCAPE
| `ORIENTATION_REVERSE_PORTRAIT
| `PASTE
| `PREFERENCES
| `PRINT
| `PRINT_PREVIEW
| `PROPERTIES
| `QUIT
| `REDO
| `REFRESH
| `REMOVE
| `REVERT_TO_SAVED
| `SAVE
| `SAVE_AS
| `SELECT_ALL
| `SELECT_COLOR
| `SELECT_FONT
| `SORT_ASCENDING
| `SORT_DESCENDING
| `SPELL_CHECK
| `STOCK of string
| `STOP
| `STRIKETHROUGH
| `Share of string
| `UNDELETE
| `UNDERLINE
| `UNDO
| `UNINDENT
| `YES
| `ZOOM_100
| `ZOOM_FIT
| `ZOOM_IN
| `ZOOM_OUT ]

Simple Widgets


type align = [ `Center | `Left | `Right ] 
type style = [ `Descr | `Label | `Title ] 
class label : ?style:style -> ?text:string -> ?align:align -> unit -> object .. end
Title label
class button : ?label:string -> ?icon:icon -> ?tooltip:string -> unit -> object .. end
class toggle : ?label:string -> ?icon:icon -> ?tooltip:string -> unit -> object .. end
class checkbox : label:string -> ?tooltip:string -> unit -> object .. end
class switchbox : ?tooltip:string -> unit -> object .. end
class spinner : ?min:int -> ?max:int -> ?step:int -> value:int -> ?tooltip:string -> unit -> object .. end
class ['a] menulist : default:'a -> render:('a -> string) -> ?items:'a list -> unit -> object .. end
class ['a] switch : 'a -> object .. end
Conceptual selector, to create toggles and radio buttons.

File Choosers


type filekind = [ `DIR | `FILE ] 
class filechooser_dialog : ?kind:filekind -> ?title:string -> ?select:string -> ?parent:GWindow.window -> unit -> object .. end
Dialog for choosing a file.
class filechooser_button : ?kind:filekind -> ?title:string -> ?select:string -> ?tooltip:string -> ?parent:GWindow.window -> unit -> object .. end

Contextual Menus


class popup : unit -> object .. end

Forms and Toolbar Layouts


type field = [ `Compact | `Editor | `Field ] 
The expansible attribute of a field.
class rack : widget list -> widget
A simple button-rack horizontal box.

A form with various field types.

The form consists of two columns, with one entry per line. Left columns is reserved for (optional) labels. Fields take place in right column. It is also possible to add widget that spans over the two columns.

The form can be horizontaly devided into sections.

Elements must be added from left-to-right, top-to-down order.

class form : unit -> object .. end

An editable list of items.
class ['a] listbox : render:('a -> string) -> ?width:int -> ?height:int -> unit -> object .. end

Layouts


class ['a] notebook : ?tabs:Gtk.Tags.position -> default:'a -> unit -> object .. end
class type entry = object .. end
class ['a] warray : ?dir:Gtk.Tags.orientation -> unit -> object .. end

Dialog



Dialog exit button categories
type 'a action = [ `ACTION of unit -> unit
| `ALT of 'a
| `APPLY
| `CANCEL
| `DEFAULT of 'a
| `SELECT of 'a ]

Dialog Window.

Dialog window are asynchroneous and modal. To open the dialog, invoke run. The method returns immediately. When running, the main window is no more sensitive (dialog is modal). When an action-button is pressed, or the method select is invoked, the associated signal is emitted, and the dialog is dismissed. Then focus goes back to the main window, and the dialog can be re-emitted.

class [[> `APPLY | `CANCEL ]] dialog : title:string -> window:GWindow.window -> ?resize:bool -> unit -> object .. end

Rich Text Renderer


class text : unit -> object .. end