]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/README
ws cleanup
[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 FormUrl.[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 filename should be the same as the .C and .h Files (i.e
32    FormTabularCreate.glade) 
33  * The root widget should be named similarly (i.e FormTabularCreate)
34  * Functional widgets, those actually used rather than the filler
35    widgets like Gtk::HBox etc,  should have an r_ as the first two
36    characters of their name. (see below)
37
38 To make the build system include your new dialog edit Makefile.am as
39 follows:
40  1) make clean in src/frontends/gnome/
41  2) Add FormX.C and FormX.h to libgnome_la_SOURCES
42  3) Remove FormX.lo and form_x.lo (if applicable) from xforms_objects
43  4) make clean && make in src/frontends/
44  5) make in src/
45
46
47 Using accessors.py
48 ------------------
49
50 Usage:
51
52 python accessors.py glade_ui_file DialogClass
53
54 Accessors.py will write the helper functions to DialogClass.C_gen and
55 the function declarations to DialogClass.g_gen.  To ensure the widgets
56 you're interested in are made available using this method, prefix the
57 widgets name with r_ when you build the dialog in Glade.