projects
/
super-star-trek.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
51dbba0
)
Beginnings of a button panel.
author
Eric S. Raymond
<esr@thyrsus.com>
Wed, 13 Sep 2006 17:57:12 +0000
(17:57 +0000)
committer
Eric S. Raymond
<esr@thyrsus.com>
Wed, 13 Sep 2006 17:57:12 +0000
(17:57 +0000)
src/xio.c
patch
|
blob
|
history
diff --git
a/src/xio.c
b/src/xio.c
index ea13d0554cc1f044dee0267736149648972a10c6..63faceada62e4320fc425ff2f14af61b19a22360 100644
(file)
--- a/
src/xio.c
+++ b/
src/xio.c
@@
-7,7
+7,7
@@
#include <X11/Xaw/AsciiText.h>
XtAppContext app_context;
#include <X11/Xaw/AsciiText.h>
XtAppContext app_context;
-Widget toplevel, form,
qui
t, text;
+Widget toplevel, form,
buttons, quit, destruc
t, text;
void quit_proc (Widget w, XtPointer client_data, XtPointer call_data)
{
void quit_proc (Widget w, XtPointer client_data, XtPointer call_data)
{
@@
-21,18
+21,22
@@
int main (int argc, char **argv)
argv, NULL, applicationShellWidgetClass,
XtNallowShellResize, True, NULL);
form = XtVaCreateManagedWidget ("form", formWidgetClass, toplevel, NULL);
argv, NULL, applicationShellWidgetClass,
XtNallowShellResize, True, NULL);
form = XtVaCreateManagedWidget ("form", formWidgetClass, toplevel, NULL);
- quit = XtVaCreateManagedWidget ("quit", commandWidgetClass, form, XtNlabel,
- "Quit", NULL);
+ buttons = XtVaCreateManagedWidget ("form", formWidgetClass, form, NULL);
+ quit = XtVaCreateManagedWidget("quit",
+ commandWidgetClass, buttons,
+ XtNlabel, "Quit", NULL);
+ destruct = XtVaCreateManagedWidget("destruct",
+ commandWidgetClass, buttons,
+ XtNfromHoriz, quit,
+ XtNlabel, "Destruct", NULL);
text = XtVaCreateManagedWidget ("text", asciiTextWidgetClass, form,
text = XtVaCreateManagedWidget ("text", asciiTextWidgetClass, form,
- XtNfromVert,
quit
, XtNresize,
+ XtNfromVert,
buttons
, XtNresize,
XawtextResizeBoth, XtNresizable, True, NULL);
XtAddCallback (quit, XtNcallback, quit_proc, NULL);
XawtextResizeBoth, XtNresizable, True, NULL);
XtAddCallback (quit, XtNcallback, quit_proc, NULL);
- if (argc <= 1)
- XtVaSetValues (text, XtNtype, XawAsciiString,
- XtNstring, "Fool! You should"
- " supply a file name!", NULL);
- else
- XtVaSetValues (text, XtNtype, XawAsciiFile, XtNstring, argv [1], NULL);
+
+ /* sample text so the widget will be identifiable */
+ XtVaSetValues (text, XtNtype, XawAsciiString,
+ XtNstring, "Command window", NULL);
XtVaSetValues (text, XtNeditType, XawtextRead, XtNdisplayCaret, False, NULL);
XtRealizeWidget (toplevel);
XtAppMainLoop (app_context);
XtVaSetValues (text, XtNeditType, XawtextRead, XtNdisplayCaret, False, NULL);
XtRealizeWidget (toplevel);
XtAppMainLoop (app_context);