C-Menu 0.2.9
A User Interface Toolkit
Loading...
Searching...
No Matches
ui_hello.c File Reference
#include "common.h"
Include dependency graph for ui_hello.c:

Go to the source code of this file.

Macros

#define _GNU_SOURCE

Functions

int main (int argc, char **argv)

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

Definition at line 3 of file ui_hello.c.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 6 of file ui_hello.c.

6 {
7 Init *init = new_init(argc, argv);
8 mapp_initialization(init, argc, argv);
9 UiConfig ui_config = {.border_style = UI_BORDER_ROUNDED};
10 ui_init(&ui_config, init->sio);
11 ui_tracked_sfc_box(12, 50, 5, 5, "Test UI Application");
13 ui_mvwaddstr(sfc, WIN, 1, 4, _("Hello!"));
14 ui_mvwaddstr(sfc, WIN, 3, 4, _("Press a key or activate the mouse:"));
15 ui_render();
16 UiEvent ev;
17 ui_get_event(sfc, WIN, NULL, &ev, -1);
19 destroy_init(init);
20 exit(EXIT_SUCCESS);
21}
UiRuntime * ui_init(const UiConfig *config, SIO *sio)
Initialize the UI runtime with the given configuration and SIO.
Definition ui_ncurses.c:129
void ui_render()
Render the UI by updating panels and refreshing the display.
Definition ui_ncurses.c:884
void ui_shutdown()
Shutdown the UI runtime, cleaning up resources and freeing memory.
Definition ui_ncurses.c:418
int sfc_ptr
Definition ui_ncurses.c:42
int ui_tracked_sfc_box(uint wlines, uint wcols, uint wbegy, uint wbegx, const char *wtitle)
Create a new surface with a box window.
Definition ui_common.c:387
UiConfig * ui_config
int ui_get_event(UiSurface *s, ss_t w, UiChyron *chyron, UiEvent *ev, int timeout_ms)
Read input events.
UiSurface * ui_surface[UI_SFC_MAX]
Definition ui_ncurses.c:40
int ui_mvwaddstr(UiSurface *s, ss_t w, uint y, uint x, const char *text)
Draw a text string at a specific position in a surface window.
#define _(String)
Definition amort.c:23
void mapp_initialization(Init *, int, char **)
Main initialization function for MAPP - Menu Application.
Definition init.c:498
Init * new_init(int argc, char **argv)
Create and initialize Init structure.
Definition mem.c:60
Init * destroy_init(Init *init)
Destroy Init structure.
Definition mem.c:91
Gathers runtime information for C-Menu Menu, Form, Pick, and View components, used for passing common...
Definition common.h:116
SIO * sio
Definition common.h:117

References UiConfig::border_style, destroy_init(), mapp_initialization(), new_init(), sfc_ptr, Init::sio, ui_get_event(), ui_init(), ui_mvwaddstr(), ui_render(), ui_shutdown(), ui_surface, and ui_tracked_sfc_box().

Here is the call graph for this function: