Folder Interaction (XForms (Forms Library) - Version 1.2 (Rev. 4) A Graphical User Interface Toolkit for X)

Next: Other Folder Routines, Previous: Folder Types, Up: Folder Object [Contents][Index]

#### 20.1.3 Folder Interaction

The folders displayed by the tabbed folder class are simply regular forms (of type `FL_FORM`), which in turn contain objects. Each folder is associated with a name (shown on the tab rider). The folder interacts with the user just like any other form. Different from other top-level forms is that only one folder is active at any time. The user selects different folders by clicking on the tab rider associated with a folder.

To set up when the application is notified about events of the tabfolder or the tabfolders callback is invoked (if installed) use

    void fl_set_object_return(FL_OBJECT *obj, unsigned int when);

where the `when` argument can be one of

`FL_RETURN_NONE`

  Never report or invoke callback even if the selected folder has been changed.

`FL_RETURN_CHANGED`
`FL_RETURN_END_CHANGED`

  Result in a notification when a folder other that the currently active one has been selected (this is the default).

`FL_RETURN_END`
`FL_RETURN_ALWAYS`

  Notify when either a new or the already active folder has been selected.

In the releases before version 1.0.92 of the library only a callback for the folder was executed (if one was installed) on change of the selected folder bur not via e.g., `fl_do_forms()` etc. This has changed with version 1.0.92. To get the old behaviour you have to build XForms with the `--enable-bwc-bs-hack` being set.

To find out which folder is currently active the following routines the tab riders are available

    FL_FORM *fl_get_active_folder(FL_OBJECT *obj);
    int fl_get_active_folder_number(FL_OBJECT *obj);
    const char *fl_get_active_folder_name(FL_OBJECT *obj);

All three functions essentially perform the same task, i.e., return a handle of the active folder, but the kind of handle returned is different. The first function returns the form associated with the folder, the second function the folder sequence number starting from 1 on the left, and the third the folder name. Depending on the application setup, one routine might be more convenient than the other two.

To find out what the previous active folder was (which may be of similar interest as the currently active one) the following functions can be used:

    FL_FORM *fl_get_folder(FL_OBJECT *obj)
    int fl_get_folder_number(FL_OBJECT *obj)
    const char *fl_get_folder_name(FL_OBJECT *obj)

Again, depending on the application, one might prefer one routine to the other two.

Next: Other Folder Routines, Previous: Folder Types, Up: Folder Object [Contents][Index]