The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
popup.c File Reference

idunn: popup windows (menus, a select's choices, popovers, tooltips). More...

#include "idunn_internal.h"
#include <stdlib.h>

Functions

idunn_window_t * idunn_popup_open (idunn_widget_t *owner, idunn_widget_t *root, gfx_rect_t anchor, idunn_side_t side, int32_t margin, bool tooltip)
 open a popup window next to anchor (a rect in owner's window) with root in it, margin pixels of room around root for its shadow.
void idunn_popup_close (idunn_window_t *popup)
 close a popup and the popups it has open.
void idunn_reap (idunn_context_t *ctx)
 free the closed popups (the app loop does it before each event)
void idunn_popup_close_all (idunn_window_t *popup)
 close a popup and the popups it came from (a chosen menu item)

Detailed Description

idunn: popup windows (menus, a select's choices, popovers, tooltips).

in an app they are heimdall popups, which the server puts next to a rect of their window and closes on a press outside them; in host tests they are offscreen windows.

Function Documentation

◆ idunn_popup_open()

idunn_window_t * idunn_popup_open ( idunn_widget_t * owner,
idunn_widget_t * root,
gfx_rect_t anchor,
idunn_side_t side,
int32_t margin,
bool tooltip )

open a popup window next to anchor (a rect in owner's window) with root in it, margin pixels of room around root for its shadow.

a popup that owner's window has open already is closed first.

Returns
the popup, or NULL.

◆ idunn_popup_close()

void idunn_popup_close ( idunn_window_t * popup)

close a popup and the popups it has open.

it is freed by idunn_reap: the event that closed it can still be using it.

◆ idunn_reap()

void idunn_reap ( idunn_context_t * ctx)

free the closed popups (the app loop does it before each event)

◆ idunn_popup_close_all()

void idunn_popup_close_all ( idunn_window_t * popup)

close a popup and the popups it came from (a chosen menu item)