Window creation: Difference between revisions
→{{header|PureBasic}}: expanding the task
(Added Odin variant) |
(→{{header|PureBasic}}: expanding the task) |
||
(4 intermediate revisions by 4 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,821 ⟶ 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,540 ⟶ 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,710 ⟶ 2,758:
{{omit from|Batch File|No access to GUI functions.}}
{{omit from|EasyLang}}
{{omit from|Logtalk}}
{{omit from|Maxima}}
|