Thingy

Here's an example using a program, Pigeon, that Andru wrote. A window named "usermanager" is created with the start element like this:

<window name="usermanager" title="Pigeon User Manager" visible="true">
  

The name of a window is important when dealing with database object sources and api calls. This particular window is used to fill in information about a user; user name and password, add him/her some groups, add ph. numbers etc. Once all the information is filled in, saving back to the database is easy with a simple api call:

.
.
.
<menuitem name="save_records1" label="_Save" stock="gtk-save">
  <trigger event="click">
    <api call="save">
      <widget>usermanager</widget>
    </api>								
  </trigger>
</menuitem>
.
.
.
  

This basically says "when the menu item "Save" is clicked, save all information entered in the window "usermanager" back to the database table.

what database table? well there's one more thing required... an association between the window "usermanager" and a database object source. This should be placed at the top of the window:

<dbobject name="pigeon_user">
  <table>pigeon_user</table>
</dbobject>
  

Another little thingy

<window name="search_window">
  <dbobject>
    <table>person</table>
    .
    .
    .
  </dbobject>
  .
  .
  .
  <[v|h]?box>
    <cell ...>
      <list>
  

This is a trigger for when an item in the list is selected.

        <trigger event="select">
  

This call loads the window specified in `widget', depending on the value(s) of data specified in the loadby `window'.

          <api call="loadby">
            <widget>personal_details_window</widget>
            <loadby>search_window</loadby>
          </api>
        </trigger>
        .
        .
        .
      </list>
    </cell>
  </[v|h]?box>
  .
  .
  .
</window>
.
.
.
  

The dbobject should have related data otherwise there is not much use of doing a loadby call.

<window name="personal_details_window">
  <dbobject>
    <table>person</table>
    .
    .
    .
  </dbobject>
</window>
  

DON'T name things with the same name, segmentation fault occurs...

Only elements which turn into widgets can have dbobject's associated with them... this means window, vbox, hbox, ... but not page, ...