This repository has been archived by the owner on Nov 20, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 137ddc6
Showing
11 changed files
with
2,569 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,17 @@ | |||
SRCS= luamotif.c widgets.c constants.c | |||
LIB= motif | |||
|
|||
CFLAGS+= -fPIC -I/usr/include -I${PKGDIR}/include -I/usr/include/lua5.1 | |||
LDADD+= -L${XDIR}/lib -L${PKGDIR}/lib -lXm -lXt -lX11 -lm -lbsd | |||
|
|||
LIBDIR= ${PKGDIR}/lib/lua/5.1 | |||
|
|||
${LIB}.so: ${SRCS:.c=.o} | |||
cc -shared -o ${LIB}.so ${CFLAGS} ${SRCS:.c=.o} ${LDADD} | |||
ln -s ${LIB}.so lib${LIB}.so | |||
|
|||
clean: | |||
rm -f *.o *.so | |||
install: | |||
cp motif.so libmotif.so /usr/lib/ | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,27 @@ | |||
SRCS= luamotif.c widgets.c constants.c | |||
LIB= motif | |||
|
|||
OS!= uname | |||
|
|||
.if ${OS} == "NetBSD" | |||
XDIR= ${X11ROOTDIR} | |||
LOCALBASE= /usr/pkg | |||
LDADD+= -R/usr/lib -R${XDIR}/lib -R${LOCALBASE}/lib | |||
.else | |||
XDIR= /usr/X11R6 | |||
LOCALBASE= /usr/local | |||
.endif | |||
|
|||
NOLINT= 1 | |||
CFLAGS+= -I${XDIR}/include -I${LOCALBASE}/include | |||
LDADD+= -L${XDIR}/lib -L${LOCALBASE}/lib -lXm -lXext -lXt -lX11 | |||
|
|||
LIBDIR= ${LOCALBASE}/lib/lua/5.1 | |||
|
|||
libinstall: | |||
|
|||
install: | |||
${INSTALL} -d ${DESTDIR}${LIBDIR} | |||
${INSTALL} lib${LIB}.so ${DESTDIR}${LIBDIR}/${LIB}.so | |||
|
|||
.include <bsd.lib.mk> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,7 @@ | |||
A Lua Binding for OpenMotif | |||
|
|||
Copyright (C) Micro Systems Marc Balmer. | |||
You can reach the author at marc@msys.ch | |||
|
|||
Makefile is for BSD systems | |||
GNUmakefile is for Linux systems |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,89 @@ | |||
require "motif" | |||
|
|||
gui = Form { | |||
fractionBase = 3, | |||
Frame { | |||
topAttachment = ATTACH_FORM, | |||
rightAttachment = ATTACH_FORM, | |||
bottomAttachment = ATTACH_POSITION, | |||
leftAttachment = ATTACH_FORM, | |||
|
|||
bottomPosition = 1, | |||
|
|||
LabelGadget { | |||
labelString = "Motif Buttons in Lua", | |||
childType = FRAME_TITLE_CHILD | |||
}, | |||
RowColumn { | |||
PushButton { | |||
labelString = "Button one", | |||
activateCallback = function() | |||
print("Button one was pressed") | |||
end | |||
}, | |||
PushButton { | |||
labelString = "Button two", | |||
activateCallback = function() | |||
print("Button two was pressed") | |||
end | |||
}, | |||
} | |||
}, | |||
TabStack { | |||
topAttachment = ATTACH_POSITION, | |||
rightAttachment = ATTACH_FORM, | |||
bottomAttachment = ATTACH_FORM, | |||
leftAttachment = ATTACH_FORM, | |||
|
|||
topPosition = 2, | |||
|
|||
tabSide = TABS_ON_BOTTOM, | |||
tabStyle = TABS_ROUNDED, | |||
|
|||
tabCornerPercent = 100, | |||
tabMarginHeight = 64, | |||
tabMarginWidth = 64, | |||
|
|||
products = LabelGadget { | |||
labelString = "frame title", | |||
}, | |||
groups = Frame { | |||
LabelGadget { | |||
labelString = "frame title", | |||
childType = FRAME_TITLE_CHILD, | |||
}, | |||
rc = RowColumn { | |||
PushButton { | |||
labelString = "pushme", | |||
activateCallback = function (w) | |||
print(tf:GetString()) | |||
tfield = w:Parent().t | |||
print(tfield:GetString()) | |||
end | |||
}, | |||
t = TextField { | |||
activateCallback = function (w) | |||
print(w:GetString()) | |||
end, | |||
valueChangedCallback = function (w) | |||
print(w:GetString()) | |||
end, | |||
focusCallback = function (w) | |||
print("Button down " .. | |||
w:GetString()) | |||
end | |||
} | |||
} | |||
}, | |||
} | |||
|
|||
} | |||
|
|||
tf = gui[2].groups.rc.t | |||
|
|||
SetLanguageProc(nil, nil, nil) | |||
toplevel, app = Initialize("XPoS") | |||
|
|||
Realize(toplevel, gui) | |||
|
|||
MainLoop(app) |
Oops, something went wrong.