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_TOOLBAR(3) FreeBSD Library Functions Manual AG_TOOLBAR(3)

AG_Toolbaragar button toolbar widget

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

The AG_Toolbar widget is a specialized container for a set of buttons which allows single or multiple selections. The buttons may be arranged in multiple rows.

AG_Object(3) -> AG_Widget(3) -> AG_Box(3) -> AG_Toolbar.

AG_Toolbar *
(AG_Widget *parent, enum ag_toolbar_type, int nRows, Uint flags);


void
(AG_Toolbar *toolbar, int row_name);


AG_Button *
(AG_Toolbar *toolbar, const char *text, int enable_default, void (*fn)(AG_Event *), const char *fnArgs, ...);


AG_Button *
(AG_Toolbar *toolbar, AG_Surface *icon, int enable_default, void (*fn)(AG_Event *), const char *fnArgs, ...);


void
(AG_Toolbar *toolbar);


void
(AG_Toolbar *toolbar, AG_Button *button);


void
(AG_Toolbar *toolbar, AG_Button *button);


void
(AG_Toolbar *toolbar, AG_Button *button);


void
(AG_Toolbar *toolbar);


void
(AG_Toolbar *toolbar); The AG_ToolbarNew() function allocates, initializes, and attaches a new AG_Toolbar widget. Acceptable flags include:

AG_TOOLBAR_HOMOGENOUS
Scale the buttons so that they cover the whole toolbar area, instead of using their preferred sizes.
AG_TOOLBAR_STICKY
Buttons should preserve their state, and only one button can be selected at any given time.
AG_TOOLBAR_MULTI_STICKY
Button should preserve their state but multiple buttons can be selected.
AG_TOOLBAR_HFILL
Expand horizontally in parent container.
AG_TOOLBAR_VFILL
Expand veritcally in parent container.
AG_TOOLBAR_EXPAND
Shorthand for AG_TOOLBAR_HFILL | .

() specifies the row number for all subsequent operations.

The () function creates a new button displaying the given text and attaches it to the current row. If the enable_default argument is 1, the button is enabled by default. The arguments fn and fnArg specify the event handler function (see AG_Event(3) for details). The callback function will be invoked whenever the user clicks on the button.

The () variant creates a button displaying a given surface instead of a label, usually an icon.

() creates a separator of appropriate orientation in the current row.

The functions () and AG_ToolbarDeselect() are used to enable or disable a given button. AG_ToolbarSelectOnly() enables the given button, disabling any other button that is currently active. AG_ToolbarSelectAll() enables all attached buttons and AG_ToolbarDeselectAll() disables all attached buttons.

The AG_Toolbar widget does not generate any event.

For the AG_Toolbar object:

AG_Box *rows[]
Containers for the rows (read-only). Widgets can be attached manually to those containers with AG_ObjectAttach(3) if AG_ToolbarButton() is not suitable.
int nRows
Number of rows (read-only).
int nButtons
Total button count (read-only).
int curRow
Current row, as selected by AG_ToolbarRow() (read-only).

AG_Box(3), AG_Button(3), AG_Event(3), AG_Intro(3), AG_Surface(3), AG_Widget(3), AG_Window(3)

The AG_Toolbar widget first appeared in Agar 1.1.

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.