Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
ex_gui_tree_lazy.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "nilorea/n_common.h"
#include "nilorea/n_log.h"
#include "nilorea/n_gui.h"
Include dependency graph for ex_gui_tree_lazy.c:

Go to the source code of this file.

Macros

#define ALLEGRO_UNSTABLE   1

Functions

static void expect_true (const char *what, int ok)
 record one check
int main (int argc, char **argv)
static void on_expand (int node, void *user_data)
 the expand callback: a "folder" gets two subfolders, both themselves openable, except the one that stands for an empty folder
static int process_args (int argc, char **argv)
 parse -V LOG_LEVEL
static const char * row (N_GUI_TREE *tree, int index)
 the text of a visible row, "" past the end

Variables

static int empty_node = -1
 nodes that stand for an empty folder: the callback adds nothing to them
static int failures = 0
static int fills = 0
 how many times the expand callback ran, and for which node last
static int last_filled = -1
 the node the callback last filled
static int log_level = 3

Macro Definition Documentation

◆ ALLEGRO_UNSTABLE

#define ALLEGRO_UNSTABLE   1

Definition at line 18 of file ex_gui_tree_lazy.c.

Function Documentation

◆ expect_true()

void expect_true ( const char * what,
int ok )
static

record one check

Definition at line 40 of file ex_gui_tree_lazy.c.

References failures, LOG_ERR, LOG_INFO, and n_log.

◆ main()

◆ on_expand()

void on_expand ( int node,
void * user_data )
static

the expand callback: a "folder" gets two subfolders, both themselves openable, except the one that stands for an empty folder

Examples
ex_gui_tree_lazy.c.

Definition at line 65 of file ex_gui_tree_lazy.c.

References empty_node, fills, last_filled, n_gui_tree_add_node(), and n_gui_tree_set_expandable().

Referenced by main(), and n_gui_tree_set_expand_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ process_args()

int process_args ( int argc,
char ** argv )
static

parse -V LOG_LEVEL

Definition at line 50 of file ex_gui_tree_lazy.c.

References log_level.

◆ row()

const char * row ( N_GUI_TREE * tree,
int index )
static

Variable Documentation

◆ empty_node

int empty_node = -1
static

nodes that stand for an empty folder: the callback adds nothing to them

Examples
ex_gui_tree_lazy.c.

Definition at line 37 of file ex_gui_tree_lazy.c.

Referenced by main(), and on_expand().

◆ failures

int failures = 0
static

Definition at line 30 of file ex_gui_tree_lazy.c.

◆ fills

int fills = 0
static

how many times the expand callback ran, and for which node last

Examples
ex_gui_tree_lazy.c.

Definition at line 33 of file ex_gui_tree_lazy.c.

Referenced by main(), and on_expand().

◆ last_filled

int last_filled = -1
static

the node the callback last filled

Examples
ex_gui_tree_lazy.c.

Definition at line 35 of file ex_gui_tree_lazy.c.

Referenced by main(), and on_expand().

◆ log_level

int log_level = 3
static

Definition at line 29 of file ex_gui_tree_lazy.c.