.\" This manual page is covered by the terms of the GNU General
.\" Public License.
.\"
-.TH GOB 1 "GOB 0.0.2"
+.TH GOB 1 "GOB 0.0.3"
.SH NAME
GOB \- The GTK+ Object Builder
.SH SYNOPSIS
.PP
GTK+ Object Builder is a simple preprocessor for easily creating
GTK+ objects. It does not parse any C code and ignores any C errors. It
-is in spirit similiar to things like lex or yacc.
+is in spirit similar to things like lex or yacc.
+
.SH TYPENAMES
.PP
Because we need to parse out different parts of the typename,
%}
.fi
+
.SH MAKING A NEW CLASS
.PP
The class header:
The third type is an argument type. It is a named datamember which
is one of the features of the GTK+ object system. You need to define a get
and a set handler. They are fragments of C code that will be used to
-get the value orset the value of the argument. Inside them you can use the
+get the value or set the value of the argument. Inside them you can use the
define ARG to which you assign the data or get the data. You can also use
the identifier "this" as pointer to the object instance. The type is
defined as one of the gtk type enums, but without the GTK_TYPE_ prefix.
.PP
For all but the init and init_class methods, you use the
following syntax for arguments. The first argument can be just "this",
-which gob will translateinto a pointer to the object instance. The rest
-of the arguments are very similiar to normal C arguments. If the
+which gob will translate into a pointer to the object instance. The rest
+of the arguments are very similar to normal C arguments. If the
typename is an object pointer you should use the syntax defined above
with the words separated by ':'
.nf
The checks are glib type preconditions, and can be the following:
"null", which tests pointers for being NULL, "type" which checks GTK+
object pointers for being the right type, "<test> <number>" which tests
-numberic arguments for being a certain value. The test can be a <,>,<=,>=
+numeric arguments for being a certain value. The test can be a <,>,<=,>=
!= or ==. Example:
.nf
(if you put ';' instead of the C code). A wrapper will also be defined
which makes calling the methods he same as public methods. This type of
method is just a little bit "slower" then normal functions, but not as
-slow as signals. You define them by using "virutal" keywrod before the
+slow as signals. You define them by using "virtual" keyword before the
prototype.
.PP
Signals:
the same should be for the argument list. The rest of the prototype is
the same as for other method types. The body can also be empty, and
also there is a public method wrapper which you can use for calling the
-signal jus tlike a public method. Example:
+signal just like a public method. Example:
.nf
signal first INT(POINTER,INT)
{
return foo(this) + i;
}
+
+.fi
+.PP
+Making new objects:
+.PP
+You should define a new method which should be a normal public method. Inside
+this method, you can use the GET_NEW macro that is defined for you and that
+will fetch a new object, so a fairly standard new method would look like:
+.nf
+
+ public GtkWidget *
+ new(void) {
+ GtkObject *ret;
+ ret = GTK_OBJECT (GET_NEW);
+ return ret;
+ }
+
.fi
+
.SH BUGS
.PP
The generated header file is included as the first file in the .c file, no
-matter what. ths means that you willhave to putthings that need to be included
+matter what. This means that you will have to put things that need to be included
before that, into an %h{ } section.
+
.SH AUTHOR
.PP
George Lebl <jirka@5z.com>