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

idunn: heads over the columns of a list view. More...

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

Macros

#define HEIGHT   26
#define HEAD_MAX   9
#define ARROW   12
#define ARROW_GAP   4

Functions

idunn_widget_t * idunn_list_heads (idunn_widget_t *list, const char *const *names, int count, idunn_callback_t on_click, void *data)
 heads over the columns of a list view, which line up with it.
void idunn_list_heads_forget (idunn_widget_t *heads)
 the list of these heads is freed
int idunn_list_heads_clicked (const idunn_widget_t *heads)
 the head that was clicked: 0 for the names, 1 and on for the columns
void idunn_list_heads_set_order (idunn_widget_t *heads, int head, bool descending)
 show the order on a head (an arrow), or on none with head -1

Detailed Description

idunn: heads over the columns of a list view.

the heads read the columns' places from the list each time they are drawn, so they line up with it at every width. the names' head is at the left; the other heads are at the right of their columns, as the numbers in them. the head of the order has an arrow.

Macro Definition Documentation

◆ HEIGHT

#define HEIGHT   26

◆ HEAD_MAX

#define HEAD_MAX   9

◆ ARROW

#define ARROW   12

◆ ARROW_GAP

#define ARROW_GAP   4

Function Documentation

◆ idunn_list_heads()

idunn_widget_t * idunn_list_heads ( idunn_widget_t * list,
const char *const * names,
int count,
idunn_callback_t on_click,
void * data )

heads over the columns of a list view, which line up with it.

a click on a head calls on_click; idunn_list_heads_clicked tells which.

Parameters
namesthe name column's head, then one for each column of idunn_list_view_set_columns.

◆ idunn_list_heads_forget()

void idunn_list_heads_forget ( idunn_widget_t * heads)

the list of these heads is freed

◆ idunn_list_heads_clicked()

int idunn_list_heads_clicked ( const idunn_widget_t * heads)

the head that was clicked: 0 for the names, 1 and on for the columns

◆ idunn_list_heads_set_order()

void idunn_list_heads_set_order ( idunn_widget_t * heads,
int head,
bool descending )

show the order on a head (an arrow), or on none with head -1