Window creation/X11: Difference between revisions
Content added Content deleted
(→Tcl: Added implementation in terms of low-level operations) |
(→Demonstration script: Add comments) |
||
Line 311: | Line 311: | ||
package require x |
package require x |
||
# With a display connection open, create and map a window |
|||
x display { |
x display { |
||
set w [x window 10 10 100 100 KeyPress] |
set w [x window 10 10 100 100 KeyPress] |
||
Line 317: | Line 318: | ||
x eventloop e { |
x eventloop e { |
||
expose { |
expose { |
||
# Paint the window |
|||
x fillrect $w 20 20 10 10 |
x fillrect $w 20 20 10 10 |
||
x text $w 10 50 "Hello, World!" |
x text $w 10 50 "Hello, World!" |
||
} |
} |
||
key { |
key { |
||
# Quit the event loop |
|||
break |
break |
||
} |
} |
||
} |
} |
||
x unmap $w |
|||
}</lang> |
}</lang> |