]> git.draconx.ca Git - gob-dx.git/blobdiff - doc/gob2.1.in
Release 2.0.12
[gob-dx.git] / doc / gob2.1.in
index 0a591df2cdb61a090d6f54ecf3b57773c4d2445a..1d386a2c0a7941f93bfdbc1d378ccd6bb5858979 100644 (file)
@@ -1,6 +1,6 @@
 .\"
 .\" gob manual page
-.\" (C) 1999,2000,2001,2002 George Lebl <jirka@5z.com>
+.\" (C) 1999,2000,2001,2002,2005 George Lebl <jirka@5z.com>
 .\" 
 .\" This manual page is covered by the terms of the GNU General
 .\" Public License.  
@@ -444,7 +444,8 @@ There is a STRING type which has only the extra \'default_value\' attribute.
 .PP
 The OBJECT type is one of the types that doesn\'t have a \'default_value\' and it
 only has an \'object_type\' attribute (in addition to nick and blurb of course)
-that is the exact object type that this property accepts.
+that is the exact object type that this property accepts.  The object_type
+should be as a type, that is for example \'Gtk:Button\'.
 .PP
 There is a BOXED type which is a pointer which has a boxed type defined
 (such that GObject knows how to copy and destroy this pointer).  Here
@@ -1026,6 +1027,66 @@ for the correct prototypes if you can\'t figure them out from the idl itself.
 Also note that the first argument is not "self", but the servant and you must
 use bonobo_object_from_servant function to get the actual object pointer.
 
+.SH DIRECT LIBGLADE SUPPORT
+.PP
+Gob can simplify writing a libglade class.  Just create a new object that
+derives from a GtkContainer widget.  Then use a "GladeXML" class flag
+with the glade file name, root widget and optional domain  as arguments
+between double quotes.  For example:
+.nf
+
+class My:Glade from Gtk:Window (GladeXML "gob-libglade.glade" "root")
+{
+  ....
+}
+
+.fi
+Note however that then "gob-libglade.glade" would have to be in the current
+directory.  You could specify a path, but that may not work for all
+installations.  You can replace the glade filename with a token to be used
+in the generated .c file and you can then have a macro with the filename,
+as follows:
+.nf
+
+class My:Glade from Gtk:Window (GladeXML GLADE_FILE "root")
+{
+  ....
+}
+
+.fi
+And somewhere in your header files you would have
+.nf
+
+#define GLADE_FILE "/path/to/file.glade"
+
+.fi
+
+You can declare widgets as data members by adding a 'GladeXML' to
+the definition.
+.nf
+
+private Gtk:Button * button1 GladeXML;
+
+.fi
+This will automatically set the "button1" from the GladeXML file.
+
+All signals created with glade are automatically connected if you defined
+those class methods in your class.  For example suppose in glade that
+we set the "connect" signal on button1 to go to on_button1_clicked, then
+in our gob file we can just write:
+.nf
+
+public void
+on_button1_clicked(self, GtkButton * button)
+{
+}
+
+.fi
+
+See the examples directory for a full example.  Note that this feature
+requires version at least 2.0.12.
+
+
 .SH IDENTIFIER CONFLICTS
 .PP
 Gob will need to define some local variables and functions in the generated