Window creation/X11: Difference between revisions
m
→{{header|BaCon}}
No edit summary |
|||
Line 657:
<lang qbasic>
'--- added a flush to exit cleanly
PRAGMA LDFLAGS `pkg-config --cflags --libs x11`
PRAGMA INCLUDE <X11/Xlib.h>
PRAGMA INCLUDE <X11/Xutil.h>
OPTION PARSE FALSE▼
▲OPTION PARSE FALSE
'---XLIB is so ugly
ALIAS XNextEvent TO EVENT
Line 676 ⟶ 677:
ALIAS XFlush TO FLUSH
'---pointer to X Display structure
DECLARE d TYPE Display*
'---pointer to the newly created window
'DECLARE w TYPE
'---pointer to the XEvent
Line 689 ⟶ 691:
'--- number of screen to place the window on
DECLARE s TYPE int
msg = "Hello, World!"
d = DISPLAY(NULL)
IF d == NULL THEN
END IF
s = SCREEN(d)
w = CREATE(d, RootWindow(d, s), 10, 10, 100, 100, 1,BlackPixel(d, s), WhitePixel(d, s))
EVENT_TYPE(d, w, ExposureMask | KeyPressMask)
MAP_EVENT(d, w)
WHILE (1)
WEND
FLUSH(d)
CLOSE_DISPLAY(d)
</lang>▼
▲</lang>
=={{header|C}}==
|