[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
X/Motif Programming questions
1. The following code, lifted from Motif Programming Manual, 6A, pp
19-20
compiles and links correctly against the supplied X libraries and RH
Motif 2.1.10
on a RH 5.2 platform. Upon running it, it does ---- nothing. It looks
pretty straightforward.
Any ideas what may be wrong? (OR less politely, what do you do when the
FM looks F'ed up?)
/////////////////////////////////////
// File: test.c
#include <Xm/PushB.h>
int main(int argc, char *argv[])
{
Widget toplevel, button;
XtAppContext app;
void button_pushed();
XmString label;
XtSetLanguageProc(NULL, NULL, NULL);
toplevel = XtVaAppInitialize(&app,
"Hello",
NULL,
0,
&argc,
argv,
NULL,
NULL);
label = XmStringCreateLocalized("Push here to say hello");
button = XtVaCreateManagedWidget("pushme",
xmPushButtonWidgetClass,
toplevel,
XmNlabelString,
label,
NULL);
XmStringFree(label);
XtAddCallback(button,
XmNactivateCallback,
button_pushed,
NULL);
XtRealizeWidget(toplevel);
XtAppMainLoop(app);
return 0;
}
void button_pushed(Widget widget, XtPointer client_data, XtPointer
call_data)
{
printf("Hello yourself!\n");
}
////////////////////////////////////
The expected output is shown on p 20. It is a small frame window, with
the pushbutton occupying
all of the client area.
2. General question: For the above item I used the standard gcc which
comes with RH 5.2.
What tools are available for "non toy" applications? Is there a decent
non thread sloppy GUI debugger available?
begin: vcard
fn: Daniel Feiglin
n: Feiglin;Daniel
org: Dilog Computers Ltd.
adr: POB 36;;;Shavei Shomron, Mobile Post;;44858;ISRAEL
email;internet: dilogsys@inter.net.il
tel;work: 972 9 861 6204
tel;fax: 972 9 862 1052
tel;home: 972 9 832 0939
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard