This repository has been archived on 2024-07-15. You can view files and clone it, but cannot push or open issues or pull requests.
hedera/docs/reference/hedera/first-tutorial.xml

65 lines
2.5 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 overriding the method <command>Vn.Form.get_actions</command> and
creating a file to describe the MenuModel used for the menu. The
name must be the name of the form prefixed by "-menu" and the
with the extension <filename>.glade</filename>. To know more about
the MenuModel definition see the GIO and GTK+ libraries
documentation on the MenuModel and the Application API.
</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>