2002-01-16 16:02:05 +00:00
|
|
|
GNOME FRONT END
|
|
|
|
===============
|
|
|
|
|
|
|
|
Firstly, this stuff is pre-alpha. I don't use it so you shouldn't
|
2002-03-16 12:55:22 +00:00
|
|
|
either. At all, no exceptions :). Secondly I'm no c++ guru, I'm
|
|
|
|
learning as I go along so if something looks stupid, there's a good
|
|
|
|
chance it is.
|
|
|
|
|
|
|
|
Adding Dialogs
|
|
|
|
--------------
|
2002-01-16 16:02:05 +00:00
|
|
|
|
|
|
|
The GNOME frontend of LyX uses libglade to draw the dialogs. The base
|
|
|
|
(GnomeBase.C) class handles the drawing and activating of the Dialogs,
|
2002-03-27 10:07:57 +00:00
|
|
|
for an example of contructing a simple dialog see GUrl.[Ch]
|
2002-01-16 16:02:05 +00:00
|
|
|
|
|
|
|
FormUrl::FormUrl(ControlUrl & c)
|
|
|
|
: FormCB<ControlUrl>(c, "FormUrl")
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To manipulate a widget you extract a pointer using getWidget(string).
|
|
|
|
|
|
|
|
If you look at FormUrl you'll see that there are a number of
|
|
|
|
helper functions at the bottom of the .C file. These are
|
|
|
|
automatically generated by accessors.py
|
|
|
|
|
2002-03-16 12:55:22 +00:00
|
|
|
For accessors.py to work glade files now must adhere to the following
|
|
|
|
conventions:
|
2002-01-16 16:02:05 +00:00
|
|
|
|
2002-03-27 10:07:57 +00:00
|
|
|
* The root widget and the file should be named after the form (i.e
|
|
|
|
FormTabularCreate & FormTabularCreate.glade)
|
2002-03-16 12:55:22 +00:00
|
|
|
* Functional widgets, those actually used rather than the filler
|
|
|
|
widgets like Gtk::HBox etc, should have an r_ as the first two
|
|
|
|
characters of their name. (see below)
|
|
|
|
|
|
|
|
To make the build system include your new dialog edit Makefile.am as
|
|
|
|
follows:
|
|
|
|
1) make clean in src/frontends/gnome/
|
2002-03-27 10:07:57 +00:00
|
|
|
2) Add GX.C and GX.h to libgnome_la_SOURCES
|
2002-03-16 12:55:22 +00:00
|
|
|
3) Remove FormX.lo and form_x.lo (if applicable) from xforms_objects
|
|
|
|
4) make clean && make in src/frontends/
|
|
|
|
5) make in src/
|
|
|
|
|
|
|
|
|
|
|
|
Using accessors.py
|
|
|
|
------------------
|
2002-01-16 16:02:05 +00:00
|
|
|
|
|
|
|
Usage:
|
|
|
|
|
|
|
|
python accessors.py glade_ui_file DialogClass
|
|
|
|
|
2002-03-27 10:07:57 +00:00
|
|
|
e.g
|
|
|
|
|
|
|
|
python accessors.py FormTabularCreate.glade GTabularCreate
|
|
|
|
|
2002-01-16 16:02:05 +00:00
|
|
|
Accessors.py will write the helper functions to DialogClass.C_gen and
|
|
|
|
the function declarations to DialogClass.g_gen. To ensure the widgets
|
|
|
|
you're interested in are made available using this method, prefix the
|
|
|
|
widgets name with r_ when you build the dialog in Glade.
|