Arbeta med widgetar
4.1. Välja widgetar från palettfönstret
Du kan arbeta med widgetarna i Palett-fönstret på följande sätt:
- Selection mode
-
To use selection mode, click on the Selector arrow. The pointer changes to an arrow to indicate that selection mode is active. In this mode, you use the mouse to select widgets in your project. You can then use the Properties window to edit the properties of the widgets.
You can also use the widget context menu to select a widget. Right-click on a widget to open the widget context menu.
You can add multiple widgets of a specific type from the Palette to your project by holding down the Control key when you select a widget. You need to click on the Selector arrow or another widget in the Palette to return to normal mode.
- Widget placement mode
-
To use widget placement mode, select a widget in the Palette window. When you select most widgets, the pointer changes to a pointer-plus-cross. You can then place the widget inside containers, top-level widgets, and so on. After you place a widget, the mode returns to selection mode.
- Top-level placement mode
-
To use top level placement mode, select a defined top-level widget in the Palette window. When you select a top-level widget in the Palette window, the widget appears immediately on your desktop. You can then edit the widget. After you select a top-level widget, the mode returns to selection mode.
4.2. Organisera widgetar i ditt projekt
You use widget containers, or boxes, to layout and organize widgets in your project window. You can choose the following widget containers from the Palette window:
- Horisontell ruta
- Vertikal ruta
- Tabell
- Fasta positioner
- Horisontell knappruta
- Vertikal knappruta
- Horisontella paneler
- Vertikala paneler
- Notebook
- Ram
- Rullbart fönster
- Viewport
You can nest boxes to create complex layout structures. When you create horizontal and vertical boxes, Glade asks you how many rows or columns to create initially, though rows and columns can easily be added or deleted later.
When you have created all the boxes you require, you can add specific widgets like labels, buttons, and more complicated widgets into the boxes. Notice that Glade packs widgets into the layout which eliminates a lot of tedious work. The use of boxes enables windows to change size to accommodate different size labels in different languages when the application is localized.
4.3. Placera en widget i urklipp
To remove a widget from a parent and place the widget on the clipboard, select the widget then choose
.4.4. Kopiera en widget till urklipp
To copy a widget to the clipboard, select the widget then choose
. The original widget remains attached to the parent.4.5. Klistra in en widget från urklipp in i ditt projekt
To paste a widget that exists on the clipboard into your project, choose
.All widgets must have a unique name within Glade. If you cut a widget, and then paste the widget into your project, then the widget and all of the children of the widget keep their original names. If you copy a widget, or paste the widget multiple times into your project, then Glade generates new names for the widget copies.