Window creation: Difference between revisions
→{{header|PureBasic}}: expanding the task
(→{{header|PureBasic}}: expanding the task) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 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,552 ⟶ 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 {
|