# Handbok för Gränssnittsbyggaren Glade

## Introduktion

Gränssnittsbyggaren Glade låter dig skapa och redigera användargränssnitt för GTK+-program.

The GTK+ library provides an extensive collection of user interface building blocks such as text boxes, dialog labels, numeric entries, check boxes, and menus. These building blocks are called widgets. You can use Glade to place widgets in a GUI. Glade allows you to modify the layout and properties of these widgets. You can also use Glade to add connections between widgets and application source code.

The user interfaces designed in Glade are stored in an XML format, enabling easy integration with external tools. You can use the libglade library to dynamically create GUIs from the XML description.

## Komma igång

### Starta Glade

Du kan starta Glade på följande sätt:

Program-menyn

- Välj Programmering Gränssnittsbyggaren Glade.

Kommandorad

- För att starta Glade från kommandoraden, ange följande kommando och tryck sedan på Return: `glade-3`

### När du startar Glade

När du startar Glade kommer följande fönster att visas.

#### Glade-fönstret

VisarGlade-fönstret.

Glade-fönstret innehåller följande element:

Menyrad

- Menyerna på menyraden innehåller alla de kommandon som du behöver för att arbeta med filer i Glade.

Verktygsrad

- Verktygsraden innehåller ett mindre antal kommandon som du kan komma åt från menyraden.

Designrutan

- Designrutan är där ett användargränssnitt kan redigeras visuellt.

Palett

- Paletten innehåller widgetar som kan användas för att bygga ett användargränssnitt.

Inspekteraren

- Inspekteraren visar information om widgetarna i ett projekt.

Egenskapsredigerare

- Egenskapsredigeraren används för att manipulera egenskaperna för widgetar, såväl som att lägga till kopplingar till källkod.

Statusrad

- The statusbar displays information about current Glade activity and contextual information about the menu items.

## Arbeta med projekt

### Skapa ett nytt projekt

För att skapa ett nytt projekt, välj Arkiv Nytt. Programmet visar ett nytt tomt projekt i Glade-fönstret.

### Öppna ett projekt

För att öppna ett befintligt projekt, välj Arkiv Öppna. Programmet visar projektet i Glade-fönstret.

### Spara ett projekt

Du kan spara projekt på följande sätt:

- För att spara ändringar till en befintlig projektfil, välj Arkiv Spara.

- To save a new project file or to save an existing project file under a new filename, choose File Save As . Enter a name for the project file in the Save As dialog, then click Save.

## Arbeta med widgetar

### 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.

### 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.

### Placera en widget i urklipp

To remove a widget from a parent and place the widget on the clipboard, select the widget then choose Edit Cut .

### Kopiera en widget till urklipp

To copy a widget to the clipboard, select the widget then choose Edit Copy . The original widget remains attached to the parent.

### Klistra in en widget från urklipp in i ditt projekt

To paste a widget that exists on the clipboard into your project, choose Edit Paste .

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.

### Ta bort en widget

To delete a widget from the parent without moving the widget to the clipboard, select the widget then choose Edit Delete .

### Ändra en egenskap för en widget

The property editor is used to edit the properties of a selected widget. To change a property of a widget, select the widget and then enter an appropriate value in one of the Property window's property fields.

## Om Glade

Glade is maintained by the Glade developers and GNOME community volunteers. To find more information about Glade, please visit the Glade Web site.

To report a bug or make a suggestion regarding this application or this manual, you can submit them using bugzilla.

Another excellent source of information are the Glade user and developer mailing lists. In addition to subscribing, you might also want to browse the list archives, available via these same links.

This program is distributed under the terms of the GNU General Public license as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. A copy of this license can be found at this link, or in the file COPYING included with the source code of this program.