You are here

How to Use the ROOT GUI Builder?

The ROOT GUI builder provides graphical user-interface (GUI) tools for developing user interfaces based on the ROOT GUI classes. It includes over 30 advanced widgets and has as a goal to offer the complete set of features needed for developing the GUI projects. It gives developers an effective object-oriented development environment and accelerates the GUI development life cycles. The GUI builder offers a palette of user interface elements. They can be selected, positioned, and grouped, laid out in the main application frame. According to the selected widget, a dynamically created context menu provides detailed control of widget attributes’ settings.

Starting GUI Builder

Select GUI builder from the canvas Inspect menu of from the ROOT Object browser (TBrowser) File menu. On the ROOT prompt line you can enter:

root[] new TGuiBuilder

Fig 1. The main window

The Builder Interface

Fig 2. Toolbar buttons

Opening an Existing User Interface

1. Click the Open button on the toolbar of the main builder window. This will bring up a File Open dialog.
2. Use the File Open dialog to navigate within your directory structure. When you locate the file of your choice, select it and then press Open button.

Saving Your User Interface

1. Click the Save button on the toolbar of the main builder window. This will bring up a File Save As dialog.
2. Navigate within your directory structure and when you locate the place of your choice, save your interface in a file by pressing the Save button. 3. If you want to save only a selected container frame, double-click on it. This will generate a macro and will execute it (showing up "what is really created into the generated code").

Fig 3. Saved user macros

Cut, Copy, Paste

1. Select a widget and coy it by pressing Copy toolbar button or using the Ctrl+C acselerator keys. 3. Click on the frame to select the position and select the Paste toolbar button or Ctrl+V keys to create a duplicate of the copied frame.

Edit Mode

Click the Edit button on the toolbar of the main window if you want to create a new user interface or to edit existing one. Alternatively, you could select Edit from the File menu.

Working with Widgets

This section describes how to create and manipulate widgets. All available widgets are classified on the left builder side in several shutter frames.

Fig 4. Different shutter frames of the widget palette

Starting Point

1. Click on New toolbar button or on the Project button in the Widget's Palette. An window appears in the builder working. Your interface now contains a single TGMainFrame instance which forms the main application window of your GUI.

Fig 5. The starting point

2. Insert a child of the main frame window by performing the following steps:

  • select a container frame from the Container shutter on the Widget Palette;
  • click on the place in the main window where you want this frame to appear;
  • resize the frame, if you need more place

3. Create additional widgets in this frame.