-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestwindow.lua
More file actions
37 lines (28 loc) · 1.17 KB
/
testwindow.lua
File metadata and controls
37 lines (28 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
-- Create the MainWindow Element.
local MainWindow = Element.new("Window");
-- Element.new(object_name: String, parent: Element | None)
-- Window type elements cannot have a parent defined.
-- Name the Window.
MainWindow.Name = "MainWindow";
-- Change the Window's title using the
-- Title property of the Window class.
MainWindow.Title = "Example Program in "..System.OS;
---- Change window's geometry to a 100x100 box.
-- MainWindow.Size = PxDim.new(400,300); Default is 400x300
---- Alter max size of window to being 300x300.
-- MainWindow.MaxSize = PxDim.new(300,300); Default is no max.
local testFrame = Element.new("Frame",MainWindow);
testFrame.Position = PxDim.new(20,20);
local testLabel = Element.new("Label",testFrame);
testLabel.Position = PxDim.new(10,10);
testLabel.Text = "im in a frame!\npos is: X:"..testLabel.Position.X.." Y:"..testLabel.Position.Y;
MainWindow.onClose = function()
print("Bye :C");
-- If MainWindow is not destroyed it will not actually
-- close your application. Beware!
MainWindow:Destroy();
end;
-- Starts the MainWindow loop.
MainWindow:Start();
-- No code can be ran after this is called,
-- assign anything you need before this.