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_PANE(3) FreeBSD Library Functions Manual AG_PANE(3)

AG_Paneagar paned container widget

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

The AG_Pane container divides its allocated space into two partitions (general-purpose AG_Box(3) containers) horizontally or vertically.

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

AG_Pane *
(AG_Widget *parent, Uint flags);


AG_Pane *
(AG_Widget *parent, Uint flags);


void
(AG_Pane *pane, int which, AG_Box *box);


void
(AG_Pane *pane, AG_Box *box1, AG_Box *box2);


void
(AG_Pane *pane, int pixels);


void
(AG_Pane *pane, int which, int min_w, int min_h);


int
(AG_Pane *pane, int x);


int
(AG_Pane *pane, int pct);


void
(AG_Pane *pane, enum ag_pane_resize_action resizeAction);

The () and AG_PaneNewVert() functions allocate, initialize, and attach a new AG_Pane container, dividing space in the specified orientation.

Acceptable flags include:

AG_PANE_DIV1FILL
By default, the size of the first (left or top) division is computed from its child widgets, and the second division is sized to use the remaining space. This option arranges for the first division to be sized from the remaining space instead.
AG_PANE_FRAME
Render decorative frames.
AG_PANE_UNMOVABLE
Do not allow the user to move the divider.
AG_PANE_HFILL
Expand horizontally in parent container.
AG_PANE_VFILL
Expand vertically in parent container.
AG_PANE_EXPAND
Shorthand for AG_PANE_HFILL | .

If AG_PANE_FRAME is set, the depth of the frame can be adjusted by invoking AG_BoxSetDepth(3) on the partitions.

By default, the two AG_Box(3) sub-containers of AG_Pane are created automatically. () allows existing boxes to be attached and re-used. which must be 0 or 1. AG_PaneAttachBoxes() is a variant that accepts two box arguments.

() sets the width of the divider widget in pixels. If the argument is 0 then the divider will be invisible and not selectable. If the argument is -1, reset to default (which is based on the zoom level).

By default, the user is allowed to move the separator such that one of the two partitions can be shrunk to zero. () prevents this by setting a minimal geometry in pixels for the given partition which (which must be either 0 or 1). If the value -1 is given, no minimum is set.

The separator can also be moved programmatically with the () function. AG_PaneMoveDivider() tries to move the divider to the specified position x (in pixels) and returns the actual new position. Note that AG_PaneMoveDivider() will not have any effect if any of the AG_PANE_FORCE_* options are set.

The () variant accepts an argument in % of total available size. If AG_PaneResizeAction() is used with AG_PANE_DIVIDE_PCT, this percentage is preserved through resizing.

() specifies the behavior of AG_Pane following a resize of the parent container widget. Possible arguments include:

AG_PANE_EXPAND_DIV1
Expand or shrink the left/upper division (default).
AG_PANE_EXPAND_DIV2
Expand or shrink the right/lower division.
AG_PANE_DIVIDE_EVEN
Divide the space evenly in two.
AG_PANE_DIVIDE_PCT
Divide the space by the percentage value specified in ().

The AG_Pane widget does not generate any event.

For the AG_Pane object:

AG_Box *div[2]
Division containers (assuming that AG_PaneAttachBox() was not used).
int dmoving
Divider is currently being moved by the user (read-only).
int dx
Actual divider position (read-only)

The following code fragment displays two expanded, multi-line AG_Textbox(3) widgets, separated horizontally by a AG_Pane.

AG_Window *win;
AG_Pane *pane;
AG_Textbox *textbox[2];

win = AG_WindowNew(0);
pane = AG_PaneNewVert(win, AG_PANE_EXPAND);
textbox[0] = AG_TextboxNew(pane->div[0],
    AG_TEXTBOX_MULTILINE|AG_TEXTBOX_EXPAND,
    NULL);
textbox[1] = AG_TextboxNew(pane->div[1],
    AG_TEXTBOX_MULTILINE|AG_TEXTBOX_EXPAND,
    NULL);
AG_PaneMoveDividerPct(pane, 50);
AG_WindowShow(win);

AG_Box(3), AG_Intro(3), AG_MPane(3), AG_Widget(3), AG_Window(3)

The AG_Pane widget first appeared in Agar 1.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.