---
name: "GToolbox"
section: "3o"
platform: "linux"
package: "liblablgtk2-ocaml-doc"
version: "2.4.0v0.2tv-8"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/GToolbox"
---

# GToolbox(3o)

Useful functions for LablGTK.

## NAME

GToolbox - Useful functions for LablGTK.

## Module

Module   GToolbox

## Documentation

Module **GToolbox**\
  :  **sig end**

Useful functions for LablGTK.

**===** **Menus** **===**

*type menu\_entry* =  **\[ \`C of string \* bool \* (bool -\> unit)** **\| \`I of string \* (unit -\> unit)** **\| \`M of string \* menu\_entry list** **\| \`R of (string \* bool \* (bool -\> unit)) list** **\| \`S \]**

Tree description of a menu

*val build\_menu* :  **GMenu.menu -\> entries:menu\_entry list -\> unit**

Build a menu from a tree description

*val popup\_menu* :  **entries:menu\_entry list -\> button:int -\> time:int32 -\> unit**

Popup a menu created from the given list of  labels and functions.

**===** **Parametrized dialog windows** **===**

*val question\_box* :  **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* :  **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* :  **title:string -\>** **?ok:string -\> ?cancel:string -\> ?text:string -\> string -\> string option**

Make the user type in a string.

**Returns**

**None** if the user clicked on cancel, or  **Some s** if the user clicked on the ok button.

*val input\_text* :  **title:string -\>** **?ok:string -\> ?cancel:string -\> ?text:string -\> string -\> string option**

Make the user type in a text.

**Returns**

**None** if the user clicked on cancel, or  **Some s** if the user clicked on the ok button.

*val select\_file* :  **title:string -\>** **?dir:string Pervasives.ref -\> ?filename:string -\> unit -\> string option**

This function allows the user to select a file and returns the selected file name. A VOIR : multi-selection ?

*type* **'a** *tree* =  **\[ \`L of 'a \| \`N of 'a \* 'a tree list \]**

A tree.

*class 'a tree\_selection :* **tree:'a tree -\>** **label:('a -\> string) -\>** **info:('a -\> string) -\>** **?packing:(GObj.widget -\> unit) -\> ?show:bool -\> unit -\> object end**

A class to make the user select a node in a tree.

*val tree\_selection\_dialog* :  **tree:'a tree -\>** **label:('a -\> string) -\>** **info:('a -\> string) -\>** **title:string -\>** **?ok:string -\>** **?cancel:string -\>** **?width:int -\> ?height:int -\> ?show:bool -\> unit -\> 'a option**

A function to make the user select a node in a tree.

**Returns** The data associated to the selected node, or None if the user canceled the selection.

**===** **Miscellaneous functions** **===**

*val autosize\_clist* :  **'a GList.clist -\> unit**

Resize the columns of a clist according to the length of the  content and the title of each column.
