Window creation/X11: Difference between revisions
Content added Content deleted
(→{{header|PureBasic}}: mark incorrect) |
(Removed PureBasic for now cause of wrong solution, will add it again when solution is found) |
||
Line 162: | Line 162: | ||
{{omit from|TI-83 BASIC}} {{omit from|TI-89 BASIC}} <!-- Does not have a local X server or network access. --> |
{{omit from|TI-83 BASIC}} {{omit from|TI-89 BASIC}} <!-- Does not have a local X server or network access. --> |
||
=={{header|PureBasic}}== |
|||
{{incorrect|PureBasic|Does not appear to be using an X11 protocol library rather than a toolkit.}} |
|||
<lang PureBasic>; A bigger font for text (not necessary) |
|||
LoadFont(1,"Arial",30,#PB_Font_Bold) |
|||
OpenWindow(1, 0, 0, 400, 300, "Window Creation", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) |
|||
Repeat |
|||
event = WaitWindowEvent() |
|||
Select event |
|||
Case #PB_Event_Repaint |
|||
; We have to repaint our Window so lets start drawing specified elements on it |
|||
StartDrawing(WindowOutput(1)) |
|||
DrawingFont(FontID(1)) ; to use our big font |
|||
Box(50, 50, 300, 200, $ff0000) |
|||
text$ = "Hello World!" |
|||
; center the text |
|||
width = TextWidth(text$) |
|||
height = TextHeight(text$) |
|||
DrawText((400 - width) / 2, (300 - height) / 2, text$,$ff, $ff0000) |
|||
StopDrawing() |
|||
Case #PB_Event_CloseWindow |
|||
Break |
|||
EndSelect |
|||
ForEver</lang> |
|||
=={{header|Python}}== |
=={{header|Python}}== |