GToolbox
Useful functions for LablGTK.
Tree description of a menu
Build a menu from a tree description
Popup a menu created from the given list of labels and functions.
val question_box :
?parent:GWindow.window_skel ->
title:string ->
buttons:string list ->
?default:int ->
?icon:GObj.widget ->
string ->
int
This function is used to display a question in a dialog box, with a parametrized list of buttons. The function returns the number of the clicked button (starting at 1), or 0 if the window is savagedly destroyed.
val message_box :
?parent:GWindow.window_skel ->
title:string ->
?icon:GObj.widget ->
?ok:string ->
string ->
unit
This function is used to display a message in a dialog box with just an Ok button. We use question_box
with just an ok button.
val input_string :
?parent:GWindow.window_skel ->
title:string ->
?ok:string ->
?cancel:string ->
?text:string ->
string ->
string option
Make the user type in a string.
val input_text :
?parent:GWindow.window_skel ->
title:string ->
?ok:string ->
?cancel:string ->
?text:string ->
string ->
string option
Make the user type in a text.
A keyboard shorcut: a combination of Alt, Control and Shift and a letter.
A shortcut specification: name of a GTK+ signal to emit, keyboard shortcuts and the message to send. The name must be unique.
val create_shortcuts :
window:GWindow.window_skel ->
shortcuts:'a shortcut_specification list ->
callback:('a -> unit) ->
unit
Setup the given shortcut spec list for the given window and callback. This create the GTK+ signal, associate the keyboard shortcuts to it, make the window listen to these shortcuts and eventually call the given callback with the messages from the shortcut specification.