AG_Titlebar
— agar
stock titlebar widget
#include <agar/core.h>
#include <agar/gui.h>
The AG_Titlebar
widget is Agar's
general-purpose window titlebar. It is derived from
AG_Box(3),
it packs an
AG_Label(3)
and optional
AG_Button(3)
controls for closing, minimizing and maximizing the window.
Note: Unless the AG_WINDOW_NOTITLE
is
used, a AG_Titlebar
is attached by default to newly
created windows (see
AG_Window(3)).
This interface is therefore rarely used directly.
AG_Titlebar *
AG_TitlebarNew
(AG_Widget
*parent, Uint
flags);
The
AG_TitlebarNew
()
function allocates, initializes, and attaches a new
AG_Titlebar
widget. Available
flags options include:
- AG_TITLEBAR_NO_CLOSE
- Disable the close control button.
- AG_TITLEBAR_NO_MINIMIZE
- Disable the
minimize
control button.
- AG_TITLEBAR_NO_MAXIMIZE
- Disable the
maximize
control button.
The AG_Titlebar
widget generates the
following events:
window-close
(void)
- The close button has been triggered.
For the AG_Titlebar object:
- AG_Window *win
- Back pointer to the attached
AG_Window(3),
if any.
- AG_Label *label
- Pointer to the
AG_Label(3)
displaying the window caption.
The AG_Titlebar
widget first appeared in
Agar 1.0.