I am running RedHat 9, GNU cc 3.2.2, lesstif-0.93.36-3.
My X programs compile fine but at runtime gives warnings (cannot find
callback list in XtAddCallback), buttons and labels dont work too.
Here is a simple test code i am using:
#include <X11/Intrinsic.h>
#include <X11/Xlib.h>
#include <X11/StringDefs.h>
#include <Xm/Xm.h>
#include <Xm/XmAll.h>
#include <Xm/PushB.h>
#include <Xm/RowColumn.h>
/* * * * G L O B A L V A R S * * * * * * * * * * * * * * * * * * * * */
XtAppContext app;
Widget quit,win,toplevel;
XmString quit_label;
/* * * * C A L L B A C K S * * * * * * * * * * * * * * * * * * * * * */
static void Quit()
{
exit();
}
/* * * * * M A I N * * * * * * * * * * * * * * * * * * * * * * * * */
int main(int argc, char *argv[])
{
/***** create the three widgets *****/
toplevel = XtAppInitialize(&app, "test1", NULL, 0, &argc,argv,NULL,NULL,0);
win = XtVaCreateManagedWidget("menu",xmRowColumnWidgetClass,toplevel,NULL);
quit = XtVaCreateManagedWidget("button",xmPushButtonWidgetClass,win,NULL);
/***** set the quit button's label *****/
quit_label = XmStringCreateLocalized("QUIT");
XtVaSetValues (quit, XmNlabelString, quit_label, NULL);
/***** add the callback *****/
XtAddCallback(quit, XmNactivateCallback, Quit, NULL);
/***** show it and let it run *****/
XtRealizeWidget(toplevel);
XtAppMainLoop(app);
}
here is my makefile:
TOOLKIT_LIB_DIR = /usr/X11R6/lib
MOTIF_LIB_DIR = /usr/X11R6/LessTif/Motif1.2/lib
MOTIF_INCLUDE_DIR = /usr/X11R6/LessTif/Motif1.2/include
CPPFLAGS = -I$(MOTIF_INCLUDE_DIR)
X11FLAGS = -I$(X11_INCLUDE_DIR)
LDLIBS= -L$(TOOLKIT_LIB_DIR) -lXm -lXt -lX11 -lm
%: %.c
cc $(CPPFLAGS) $(X11FLAGS) -o $@ [EMAIL PROTECTED] $(LDLIBS)
Any clue ?????
Thanks
- @t
_______________________________________________
Lesstif mailing list
[EMAIL PROTECTED]
https://terror.hungry.com/mailman/listinfo/lesstif