Window creation/X11: Difference between revisions

Added Yabasic
m (→‎{{header|Wren}}: Minor tidy)
(Added Yabasic)
 
(2 intermediate revisions by the same user not shown)
Line 1,148:
bye
</syntaxhighlight>
 
=={{header|FreeBASIC}}==
=== Xlib ===
{{libheader|Xlib}}
<syntaxhighlight lang="vbnet">#include once "X11/Xlib.bi"
 
Dim As Display Ptr dpy
Dim As Window win
Dim As GC gc
Dim As XEvent ev
 
dpy = XOpenDisplay(NULL)
win = XCreateSimpleWindow(dpy, XDefaultRootWindow(dpy), 0, 0, 400, 300, 0, 0, 0)
gc = XCreateGC(dpy, win, 0, NULL)
XSelectInput(dpy, win, ExposureMask Or KeyPressMask)
XMapWindow(dpy, win)
 
While XNextEvent(dpy, @ev) = 0
If ev.type = Expose Then
XDrawString(dpy, win, gc, 200, 150, "Hello World", 11)
EndIf
Wend
 
XCloseDisplay(dpy)</syntaxhighlight>
 
=={{header|Go}}==
Line 1,832 ⟶ 1,856:
(bye)</syntaxhighlight>
 
=={{header|PythonPureBasic}}==
PureBasic does not have direct support for the X11 library like Xlib or XCB.
 
See [[Window_creation#PureBasic]].
 
=={{header|Python}}==
=== Xlib ===
{{field attention|Python|X11|Note (stolen from CLX example): This example was written in near-total ignorance of X11 by consulting the python-xlib's examples (included in its distribution) to find equivalents for the parts of the C example.}}
Line 2,498 ⟶ 2,526:
 
{{out}}
<pre>Same as C example.</pre>
<pre>
 
Same as C example.
=={{header|Yabasic}}==
</pre>
<syntaxhighlight lang="vbnet">open window 300,200
 
text 150, 100, "Hello World"
 
rectangle 10,10 to 90,90
fill rectangle 40,40,60,60
 
clear screen
 
inkey$
close window</syntaxhighlight>
 
{{omit from|ACL2}}
2,123

edits