# Glade Interface Designer

## Quick start

If you don't want to read all this boring manual, here is few steps to get all things ready for use:

1. You should have a project containing Glade file opened;

2. Unlike original Glade designer, Anjuta plugin uses double click for creating handlers for default signal. You can perform a click on widgets (e.g. switch current tab in a GtkNotebook) by keeping "Windows" or "Super" key pressed;

3. Open Preferences Glade GUI Designer and check the three topmost flags Insert handler on edit, Separated designer layout and Automatically add resources;

4. Check View Designer flag and move this window to a better place;

5. Switch to a Glade file in the design area and to the source code file that should contain callbacks for the Glade file, then press Glade Associate last designer and editor;

6. Optionally select a target for image and other resources in the project manager and press Set as default resource target in the context menu.

## Glade general usage questions

Glade plugin mostly copies functionality of standalone Glade designer, but there are some special features. The four windows of the Glade desinger are design area, palette, widgets inspector and property editor. They have the same purpose as in the standalone designer, so please consult Glade Interface Designer Manual for their description. An extra functionality allows you to use infrastructure of Anjuta more effectively and is described here.

## Editor and designer association

You can associate text editor and Glade designer so you will easily switch between them and automatically insert handler stubs for newly entered handlers. You can associate more then one editor to a designer. The most recent editor or associated with the current toplevel widget will be used. There are two ways of associating editor and designer. The first way is using associations dialog. The second way is to choose designer and editor document in any order and then press Glade Associate last designer and editor menu item.

## Associations dialog

Allows you to create and manager associations. To create an association select designer and editor in the comboboxes and press Associate. You can also select the document by switching to it in document manager or windows list in the main menu. The list in the middle of the dialog shows existing associations. A couple of controls below are intended for editing association properties. Here is their description:

Spec regexp

  Shortened from "special regular expression". Used for defining a custom position for inserting stubs.

Widget name

  The name of the toplevel widget this assoctiation belongs to.

Position type

  Describes a position at which a handler stub will be inserted. After begin means after special mark (which may be entered in the Spec regexp entry) and before end means before special end mark. Default begin mark is /* window_name callbacks */ and default end mark is /* end of window_name callbacks */. window_name may be ommited.

## Default signal

Double click on a widget in the design area will create a new handler for default signal using a predefined template for its naming. For example, the default signal is "clicked" for button, "toggled" for check box, etc. If Insert handler on edit option is enabled then a new handler stub will be inserted to the position which depends on Position type setting.

## Inserting a stub

One of the most valuable goal of Anjuta and Glade integration is automatical creating of handler stubs, so you will not need to do a lot of routine work for that, it will be done automatically.

There are several ways to create a stub:

- Automatically if Insert handler on edit option if enabled

- Using Glade Insert handler stub, autoposition in hte main menu

- Using Insert handler stub item in the context menu of text document

## Preferences

Insert handler on edit

  Enables inserting a handler stub into the associated editor after entering a new handler into signal editor or creating a default signal handler

Separated designer layout

  Detaches the design area from document manager so you can dock it separately from text editors.

Automatically add resources

  When checked then all resources (e.g. images) will be added to the target in the current project. You can choose the target using project manager context menu or by entering target id in the entry below the check button.

Handler template

  You can choose between the two formats of automatic naming of signal handler.