]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/README
A lean, clean and working start to the new, improved gnome frontend.
[lyx.git] / src / frontends / gnome / README
1 GNOME FRONT END
2 ===============
3
4 Firstly, this stuff is pre-alpha.  I don't use it so you shouldn't
5 either.  At all, no exceptions :). Secondly I'm no c++ guru, I'm
6 learning as I go along so if something looks stupid, there's a good
7 chance it is.
8
9 Adding Dialogs
10 --------------
11
12 The GNOME frontend of LyX uses libglade to draw the dialogs.  The base
13 (GnomeBase.C) class handles the drawing and activating of the Dialogs,
14 for an example of contructing a simple dialog see GUrl.[Ch]
15
16 FormUrl::FormUrl(ControlUrl & c)
17         : FormCB<ControlUrl>(c, "FormUrl")
18 {}
19
20
21
22 To manipulate a widget you extract a pointer using getWidget(string).
23
24 If you look at FormUrl you'll see that there are a number of
25 helper functions at the bottom of the .C file.  These are
26 automatically generated by accessors.py
27
28 For accessors.py to work glade files now must adhere to the following
29 conventions: 
30
31  * The root widget and the file should be named after the form (i.e
32    FormTabularCreate & FormTabularCreate.glade)  
33  * Functional widgets, those actually used rather than the filler
34    widgets like Gtk::HBox etc,  should have an r_ as the first two
35    characters of their name. (see below)
36
37 To make the build system include your new dialog edit Makefile.am as
38 follows:
39  1) make clean in src/frontends/gnome/
40  2) Add GX.C and GX.h to libgnome_la_SOURCES
41  3) Remove FormX.lo and form_x.lo (if applicable) from xforms_objects
42  4) make clean && make in src/frontends/
43  5) make in src/
44
45
46 Using accessors.py
47 ------------------
48
49 Usage:
50
51 python accessors.py glade_ui_file DialogClass
52
53 e.g
54
55 python accessors.py FormTabularCreate.glade GTabularCreate
56
57 Accessors.py will write the helper functions to DialogClass.C_gen and
58 the function declarations to DialogClass.g_gen.  To ensure the widgets
59 you're interested in are made available using this method, prefix the
60 widgets name with r_ when you build the dialog in Glade.