This wiki is being migrated to

User Tools

Site Tools


GUI (gui.h)

Header {z88dk}/include/gui.h
Source {z88dk}/libsrc/graphics/x11 (part of)
Include #include <gui.h>
Linking -lx11
Compile n/a

Very basic but portable windowing functions, based on the monochrome graphics library.

It is now part of the X11 emulation library.

Windowing API

gui_win structure

struct gui_win {
        char    *back;
        char    x;
        char    y;
        char    width;
        char    height;
        char    flags;

The gui_win structure includes a pointer to a sprite-like formatted memory area, the x and y coordinates and its size. The flags describe the graphical appearance and can combine the following features:


There is a further possibility: defining the “ALTGUI” flag at compile time the “round corners” mode is activated.

win_open(struct gui_win win)

Allocates a memory space for storing the background area (see malloc) and paints a clean box.


// #include "malloc.h"  <--  This should be defined, in a real case
#include "gui.h"

  struct gui_win win;

  win->x = 30; win->y = 15;
  win->flags = WIN_BORDER|WIN_SHADOW;
  win->height = 20; win->width = 40;
  win_open (win);

win_close(struct gui_win win)

Recovers the background area and frees the relative memory area.


  win_close (win);
library/wingui.txt · Last modified: 2017/03/24 07:27 (external edit)