Graphical Interface Development with Glade2
Author: Rikke D. Giles, copyright Rikke D. Giles 2003
A Quick Tour of Glade: Page 2
The Files Glade Produces
When you click save in the main glade window, glade will save two files to the
directory you specified with the project options button or menu item. If you did
not specify any project name, glade will save the project in the /Projects directory
in your home shell. The project will be called 'Project#' where # is a number which
is dependent upon how many projects you have created. It's best to name the
project/application right away to minimize confusion. Replace project# with the name of your
application below, if you have named it.
The two files created with save are:
- Project1.glade
- Project1.gladep
where 'Project1' can be the name of the project you've given in options, etc.
These two files contain the xml used by glade, or libglade to load the
application windows you have created. If you have glade build your project,
the *.glade file will be used with libglade. If you prefer to call libglade
in your application, you'll use the *.glade files directly in the application.
Glade builds all the files needed to generate the GUI for an application
when you click Build in the main glade window. Since these files can be
somewhat confusing, especially if you've little knowledge of building applications
under Linux, they will be discussed in depth below.
- In the project# directory
- acconfig.h/autogen.sh/configure.in/Makefile.am/stamp-h.in
These files are all necessary for the autoconf/autogen/automake systems which
automate compiling and library dependencies in Linux. Generally Glade users
just need to type ./autogen.sh to configure their application and generate
the Makefiles needed. If the project requires a special library, the library
will be added into the configure files, or into the generated Makefiles.
- AUTHORS/ChangeLog/README/NEWS
These files are meant to be used if the application is ever distributed.
They are standard distribution files and each one should be tailored to the
specific application.
- macros subdirectory
This subdirectory holds the macros needed by the autoconf and autogen etc,
systems. You shouldn't have to mess with this directory at all.
- po subdirectory
This is where the po translation files are stored. If you are not internationalizing
your application with gettext, there is little to worry about here.
- src subdirectory
See below
- In the project#/src directory
- main.c
This file contains main(), the initial function for all C programs. Glade only
produces this file when it is missing, so you can edit it as you wish. When Glade first
writes main.c it enables all windows you have built to be shown. You will have
to edit the file if you only want one window to show on the start of the application.
- support.c
This file contains glade support functions and should not be edited. One of
the most useful functions included here is lookup_widget(), which allows you
to find a particular widget by name given another widget, assuming they are in
the same 'tree' of widgets (ie belong to the same window, etc).
- callbacks.c
This file is where glade writes all the callbacks and signal handlers. Glade does
not rewrite this file, but only appends to it as you need more callbacks. You
will have to provide the guts of the callback functions, as glade only writes out an
empty function for callback.
- interface.c
This is another file, like support.c, which should not be edited. Here Glade writes
out the functions to create the GUI. There should never be a need to edit this
file, and if you do edit it, be warned that Glade will overwrite it the next time
you build your application.
- Makefile.am/Makefile.in/Makefile
These files are created by the automake/autoconf packages and provide the guidelines
used by gcc to compile the application. Add included libraries, new source files, etc, here.