[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: LuaMotif and setting X resources
- From: Marc Balmer <marc@...>
- Date: Sun, 08 Apr 2012 09:16:23 +0200
When you write an OpenMotif program without specifying any X resources,
the result looks very "bare-minimum". Usually you put the resources as
strings in a file that has the same name as the application class and
put that file in /etc/X11/app-defaults.
I added code to LuaMotif so that you can pass the resources as a table
of strings (other values in the table are ignored) to the Initialize
function, so you can keep the resources with your Lua program (they were
separate files X because often you would not have the source code for
the program you modify the look and feel):
resources = {
'*fontList: variable',
'*renderTable: variable',
'*renderTable.variable.fontName: Arial',
'*renderTable.variable.fontSize: 14',
'*renderTable.variable.fontType: FONT_IS_XFT'
}
toplevel, app = Initialize("Demos", resources)
rc = RowColumn {
PushButton {
labelString = "Hello",
activateCallback = function () print('Hello') end
},
PushButton {
labelString = "Goodbye",
activateCallback = function () SetExitFlag(app) end
}
}
Realize(toplevel, rc)
MainLoop(app)
I will add Xt Intervals and Inputs laters, so this is slowly getting
useful (fwiw, I use it for touchscreen apps that run in fullscreen mode).