Window creation: Difference between revisions
→{{header|PureBasic}}: expanding the task
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
(→{{header|PureBasic}}: expanding the task) |
||
(5 intermediate revisions by 5 users not shown) | |||
Line 810:
gsv+close drop
[THEN]</syntaxhighlight>
===iMops===
{{works with|iMops on MacOS}}
<syntaxhighlight lang="iMops">
Window+ w \ create a window
View v \ create a view
300 30 430 230 put: frameRect \ size a rectangle for the view
frameRect " Test" docWindow v new: w \ activate the view and window
show: w \ display the window
</syntaxhighlight>
=={{header|FreeBASIC}}==
Line 1,620 ⟶ 1,632:
execute with:
ocaml -I +Xlib Xlib.cma sample.ml
=={{header|Odin}}==
<syntaxhighlight lang="odin">package main
import "vendor:sdl2"
main :: proc() {
using sdl2
window: ^Window = ---
renderer: ^Renderer = ---
event: Event = ---
Init(INIT_VIDEO)
CreateWindowAndRenderer(
640, 480,
WINDOW_SHOWN,
&window, &renderer
)
SetWindowTitle(window, "Empty window")
RenderPresent(renderer)
for event.type != .QUIT {
Delay(10)
PollEvent(&event)
}
DestroyRenderer(renderer)
DestroyWindow(window)
Quit()
}</syntaxhighlight>
=={{header|OpenEdge ABL/Progress 4GL}}==
Line 1,789 ⟶ 1,833:
=={{header|PureBasic}}==
<syntaxhighlight lang="purebasic">Define
x = 400
y = 300
If CreateImage(0, x, y) And StartDrawing(ImageOutput(0))
DrawingMode(#PB_2DDrawing_Transparent)
Box(0, 0, x, y, #White)
Repeat▼
DrawText(x/3, y/2, "Hello World!", #Black)
Select Event▼
;DrawText(Random(200), Random(200), "Hello World!", RGB(Random(255), Random(255), Random(255)))
Next i
StopDrawing()
ImageGadget(0, 0, 0, x, y, ImageID(0))
EndIf
▲ Repeat
Event = WaitWindowEvent()
▲ Select Event
Case #PB_Event_Gadget
Case #PB_Event_CloseWindow
EndSelect
ForEver
EndIf</syntaxhighlight>
=={{header|Python}}==
Line 2,508 ⟶ 2,564:
newForm.Show()</syntaxhighlight>
=={{header|V (Vlang)}}==
<syntaxhighlight lang="Zig">
import gg
import gx
fn main() {
mut app := gg.new_context(
bg_color: gx.white
resizable: true
create_window: true
width: 600
height: 600
frame_fn: frame
window_title: "Empty Window"
)
app.run()
}
fn frame(mut ctx gg.Context) {
ctx.begin()
ctx.end()
}
</syntaxhighlight>
=={{header|Wren}}==
{{libheader|DOME}}
<syntaxhighlight lang="
class EmptyWindow {
Line 2,678 ⟶ 2,758:
{{omit from|Batch File|No access to GUI functions.}}
{{omit from|EasyLang}}
{{omit from|Logtalk}}
{{omit from|Maxima}}
|