GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
AG_NOTEBOOK(3) FreeBSD Library Functions Manual AG_NOTEBOOK(3)

AG_Notebookagar notebook container widget

#include <agar/core.h>
#include <agar/gui.h>

The AG_Notebook widget maintains a set of AG_Box(3) containers, only one of which is visible at any given time. The user can select the visible container by clicking on a tab, or it can be selected programmatically.

AG_Object(3) -> AG_Widget(3) -> AG_Notebook.

AG_Notebook *
(AG_Widget *parent, Uint flags);


void
(AG_Notebook *nb, int padding);


void
(AG_Notebook *nb, int spacing);


void
(AG_Notebook *nb, enum ag_notebook_tab_alignment alignment);


void
(AG_Notebook *nb, int flag);

The () function allocates, initializes, and attaches a new AG_Notebook widget. Acceptable flags include:

AG_NOTEBOOK_HIDE_TABS
Don't display the tab selector controls.
AG_NOTEBOOK_HFILL
Expand horizontally in parent container.
AG_NOTEBOOK_VFILL
Expand vertically in parent container.
AG_NOTEBOOK_EXPAND
Shorthand for AG_NOTEBOOK_HFILL | .

() and AG_NotebookSetSpacing() sets the default AG_Box(3) padding and spacing to use for new tabs.

By default, tabs are drawn at the top of the widget. () changes the location of the tabs, where the argument is one of:

enum ag_notebook_tab_alignment {
	AG_NOTEBOOK_TABS_TOP,
	AG_NOTEBOOK_TABS_BOTTOM,
	AG_NOTEBOOK_TABS_LEFT,
	AG_NOTEBOOK_TABS_RIGHT
};

() toggles the visibility of the tab header.

AG_NotebookTab *
AG_NotebookAdd(AG_Notebook *nb, const char *name, enum ag_box_type type);


void
(AG_Notebook *nb, AG_NotebookTab *tab);


AG_NotebookTab *
(AG_Notebook *nb, int tabID);


AG_NotebookTab *
(AG_Notebook *nb, const char *text);


void
(AG_Notebook *nb, AG_NotebookTab *tab);


void
(AG_Notebook *nb, int id);

() creates a new tabbed container. name is an arbitrary text label to be displayed on the tab header. The type argument sets the type of AG_Box(3), that is either for AG_BOX_HORIZ horizontal packing, or AG_BOX_VERT for vertical packing (see AG_Box(3) for details). AG_NotebookAdd() returns a pointer to the newly created AG_NotebookTab container widget (a subclass of AG_Box(3)).

() removes the given tabbed container, detaching and freeing all associated child widgets.

() returns the tab with given numerical ID (or NULL).

() looks up a tab based on the contents of its text label and returns a pointer to the tab (or NULL).

The () function selects the active tabbed container.

() selects the container by numerical ID.

The AG_Notebook widget does not generate any event.

For the AG_Notebook object:

TAILQ tabs
The list of tabs as AG_NotebookTab objects.
Uint nTabs
Total number of tabs.
AG_NotebookTab *selTab
Pointer to the currently selected tab.
int selTabID
Numerical ID of currently selected tab.

For the AG_NotebookTab object:

AG_Label *lbl
Pointer to the AG_Label(3) of the tab (or NULL).
int id
The numerical ID associated with the tab.

The following code fragment creates a notebook with two tabs:

AG_Notebook *nb;
AG_Notebook *ntab;

nb = AG_NotebookNew(parent, AG_NOTEBOOK_EXPAND);
{
	ntab = AG_NotebookAdd(nb, "Tab #1", AG_BOX_VERT);
	AG_LabelNew(ntab, 0, "This is Tab #1");

	ntab = AG_NotebookAdd(nb, "Tab #2", AG_BOX_VERT);
	AG_LabelNew(ntab, 0, "This is Tab #2");
}

AG_Intro(3), AG_Widget(3), AG_Window(3)

The AG_Notebook widget first appeared in Agar 1.0. AG_NotebookGetByID() and AG_NotebookSelectByID() appeared in Agar 1.6.0.

December 21, 2022 Agar 1.7

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.