Window creation/X11: Difference between revisions
Content added Content deleted
SqrtNegInf (talk | contribs) m (→{{header|Raku}}: Fix comment: Perl 6 --> Raku) |
(→{{header|Tcl}}: + standard ML) |
||
Line 1,754: | Line 1,754: | ||
}</lang> |
}</lang> |
||
=={{header|Standard ML}}== |
|||
Works with PolyML |
|||
<lang Standard ML>open XWindows ; |
|||
val dp = XOpenDisplay "" ; |
|||
val w = XCreateSimpleWindow (RootWindow dp) origin (Area {x=0,y=0,w=400,h=300}) 3 0 0xffffff ; |
|||
XMapWindow w; |
|||
XFlush dp ; |
|||
XDrawString w (DefaultGC dp) (XPoint {x=10,y=10}) "Hello World!" ; |
|||
XFlush dp ;</lang> |
|||
=={{header|Tcl}}== |
=={{header|Tcl}}== |
||
Tcl does not come with a low-level connection to the X protocol, as it has long been distributed with [[Tk]] which offers a [[Simple Windowed Application|much higher-level interface]] (and which is portable to other platforms too). This means that the interface has to be crafted directly. This can be done with either [http://www.swig.org/ SWIG] or [[critcl]]. This example shows how to do it the latter way: |
Tcl does not come with a low-level connection to the X protocol, as it has long been distributed with [[Tk]] which offers a [[Simple Windowed Application|much higher-level interface]] (and which is portable to other platforms too). This means that the interface has to be crafted directly. This can be done with either [http://www.swig.org/ SWIG] or [[critcl]]. This example shows how to do it the latter way: |