68 lines
2.6 KiB
XML
68 lines
2.6 KiB
XML
<?xml version="1.0"?>
|
|
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
|
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
|
]>
|
|
<refentry id="first-tutorial">
|
|
<refmeta>
|
|
<refentrytitle>First form</refentrytitle>
|
|
<manvolnum>0</manvolnum>
|
|
<refmiscinfo>Hedera Library</refmiscinfo>
|
|
</refmeta>
|
|
|
|
<refnamediv>
|
|
<refname>First form</refname>
|
|
<refpurpose>
|
|
In this first tutorial you will learn how to create a simple
|
|
form
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsection id="defining-form">
|
|
<title>Defining a form</title>
|
|
<para>
|
|
<!-- FIXME: add description of the XML DEFINITION of a form in the module file
|
|
-->
|
|
</para>
|
|
</refsection>
|
|
<refsection id="form-files">
|
|
<title>Files needed to create a form</title>
|
|
<para>
|
|
The most basic form is made up of a class that inherits from
|
|
<link linkend="VnForm">VnForm</link>
|
|
and a <link linkend="GtkBuilder">GtkBuilder</link> file, which
|
|
defines the UI of the form. This UI file is expected to use the
|
|
<filename>.glade</filename> extension and named after the form that
|
|
will use it. This <filename>.glade</filename> file must contain a
|
|
toplevel <link linkend="GtkBox">GtkBox</link> with the name
|
|
<literal>main</literal>, that will be recognized by the library as
|
|
the content of the <link linkend="GtkNotebook">GtkNotebook</link>
|
|
used by the runtime and will be autamtically inserted in a page of
|
|
that notebook while opening the form, integrating as a part of the
|
|
application.
|
|
</para>
|
|
<para>
|
|
The <filename>.glade</filename> file for a form may also contain a
|
|
<link linkend="VnBatch">VnBatch</link> called
|
|
<literal>models</literal> which the library will recognize as a
|
|
group of models used by the form, and will set the application
|
|
connection to these automatically.
|
|
</para>
|
|
<para>
|
|
Additionally, the form can add menus to the main application
|
|
by adding a <link linkend="GtkActionGroup">GtkActionGroup</link>
|
|
named <literal>actions</literal> in the <filename>.glade</filename>
|
|
file, and using another file named also after the form, with the
|
|
extension <filename>.ui</filename>. This file uses the
|
|
<link linkend="GtkUIManager">GtkUIManager</link> syntax,
|
|
and will be used to define the strcuture of the menus and will
|
|
link the options to the actions defined in the previously mentioned
|
|
<literal>actions</literal>
|
|
<link linkend="GtkActionGroup">GtkActionGroup</link>.
|
|
</para>
|
|
<para>
|
|
There is also the possibility to define SQL files, to set and edit
|
|
the SQL queries apart from the other parts of the module.
|
|
</para>
|
|
<!-- FIXME: add sections to explain how these things are done -->
|
|
</refsection>
|
|
</refentry>
|