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 (parent:
304e25e
)
We know how to extract the button name within the callback.
author
Eric S. Raymond
<esr@thyrsus.com>
Thu, 14 Sep 2006 02:58:40 +0000
(
02:58
+0000)
committer
Eric S. Raymond
<esr@thyrsus.com>
Thu, 14 Sep 2006 02:58:40 +0000
(
02:58
+0000)
src/xio.c
patch
|
blob
|
history
diff --git
a/src/xio.c
b/src/xio.c
index 6985cc9a7d01bbde9bc14be26bf6b8e17d75991b..615ea97610ae441b913b12167f2a4e2afd007d4c 100644
(file)
--- a/
src/xio.c
+++ b/
src/xio.c
@@
-39,6
+39,7
@@
static void noargs_proc(Widget w, XtPointer client_data, XtPointer call_data)
/* use this for commands that take no arguments */
{
/* currently a stub */
/* use this for commands that take no arguments */
{
/* currently a stub */
+ printf("Button %s pressed\n", XtName(w));
}
static struct cmd_t commands[] = {
}
static struct cmd_t commands[] = {
@@
-80,7
+81,7
@@
static struct cmd_t commands[] = {
#define MAXWIDTH 640
#define TEXTHEIGHT 200
#define MAXWIDTH 640
#define TEXTHEIGHT 200
-
int
main(int argc, char **argv)
+
static void instantiate_
main(int argc, char **argv)
{
struct cmd_t *cp;
{
struct cmd_t *cp;
@@
-158,5
+159,10
@@
int main(int argc, char **argv)
XtAppMainLoop(app_context);
/* loop may be interrupted */
XtDestroyApplicationContext(app_context);
XtAppMainLoop(app_context);
/* loop may be interrupted */
XtDestroyApplicationContext(app_context);
+}
+
+int main(int argc, char **argv)
+{
+ instantiate_main(argc, argv);
exit(0);
}
exit(0);
}