home *** CD-ROM | disk | FTP | other *** search
-
- # sample program at the end of the user manual
-
- xtAppInitialize
-
- xmMainWindow .main managed
- xmForm .main.form managed
- xmList .main.form.list managed
- xmPushButton .main.form.btn1 managed
- xmPushButton .main.form.btn2 managed
-
- .main setValues -workWindow .main.form
-
- .main.form.list setValues \
- -itemCount 3 \
- -items "one, two, three" \
- -selectionPolicy single_select
- .main.form.btn1 setValues -labelString Quit
- .main.form.btn2 setValues -labelString "Do nothing"
-
- .main.form.btn1 activateCallback {exit 0}
- .main.form.list singleSelectionCallback {puts stdout "Selected %item"}
-
- .main.form.list setValues \
- -topAttachment attach_form \
- -leftAttachment attach_form \
- -bottomAttachment attach_form
- .main.form.btn1 setValues \
- -topAttachment attach_form \
- -leftAttachment attach_widget \
- -leftWidget .main.form.list
- .main.form.btn2 setValues \
- -topAttachment attach_widget \
- -topWidget .main.form.btn1 \
- -leftAttachment attach_widget \
- -leftWidget .main.form.list \
-
-
- . realizeWidget
- . mainLoop
-
-