-
Notifications
You must be signed in to change notification settings - Fork 4
/
hello_dialog.lua
63 lines (52 loc) · 1.58 KB
/
hello_dialog.lua
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
local motif = require 'motif'
function popup(button)
local dialog = button:CreateInformationDialog("info")
dialog.messageString = "Hello, world!"
dialog.okCallback = function ()
print('OK was pressed')
end
motif.Realize(button:XtParent(), dialog)
dialog:XtParent():Popup(motif.GrabNone)
end
motif.SetLanguageProc(nil, nil, nil)
resources = {
'*fontList: variable',
'*renderTable: variable',
'*renderTable.variable.fontName: Arial',
'*renderTable.variable.fontSize: 14',
'*renderTable.variable.fontType: FONT_IS_XFT',
-- Color definitions
'*foreground: #000000',
'*background: #c1c1c1',
'*XmList.background: #999999',
'*XmPushButton.background: #999999',
'*XmDrawnButton.background: #999999',
'*XmRowColumn*OptionButton.background: #999999',
'*XmArrowButton.background: #c1c1c1',
'*XmText.background: #b98e8e',
'*XmScrolledWindow.XmText.background: #000000',
'*XmTextField.background: #b98e8e',
'*XmScrollBar.background: #999999',
'*XmScrollBar.foreground: #999999',
'*XmScale*foreground: #000000',
'*XmMenuShell*background: #c1c1c1',
'*XmMenuShell*XmToggleButton.selectColor: #000000',
'*highlightColor: #000000',
'*form*statusBar*foreground: #c1c1c1',
'*form*statusBar*troughColor: #b98e8e',
'*form*helpButton*background: #9f8484',
'*form*textLabel*background: #999999'
}
app, toplevel = motif.Initialize("Demos", resources)
rc = motif.RowColumn {
motif.PushButton {
labelString = "Hello",
activateCallback = popup
},
motif.PushButton {
labelString = "Goodbye",
activateCallback = function () app:SetExitFlag() end
}
}
motif.Realize(toplevel, rc)
app:MainLoop()