Window creation/X11: Difference between revisions

Added PureBasic
(Added PureBasic)
Line 162:
 
{{omit from|TI-83 BASIC}} {{omit from|TI-89 BASIC}} <!-- Does not have a local X server or network access. -->
 
=={{header|PureBasic}}==
<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}}==
Anonymous user