lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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).