Quoting [EMAIL PROTECTED]:

  Hi,

  I don't know too much about motif, but, as it is close to Xaw, the first
problem I see is that you should create the label widget with
XtCreateManagedWidget, or call XtManageChild before calling XtRealize
on the toplevel widget.

  You can try a Xaw version, replacing the line:
#include <Xm/Label.h>
by
#include <X11/Xaw/Label.h>
and
  wc = xmLabelWidgetClass;
by
  wc = labelWidgetClass;

and create wlabel using XtCreateManagedWidget, than, link it as

gcc -o mytest x.c -I/usr/X11R6/include -L/usr/X11R6/lib -lXaw -lXt -lX11

also, instead of setting i to 0, try
  i = XtNumber(args);

> The  program below workis fine in Unix, but I get a BadWindow error
> when
> running on Linux RedHat 6.2.
> Could you help me?
> Regards
> 
> Giovanni Colombo
> ENEL.HYDRO
> Business Unit Polo Idraulico e Strutturale
> Via Pozzobonelli, 6 - 20162 Milano (Italy)
> Tel: +39 02 7224.3649
> Fax: +39 02 7224.3550
> Mailto:[EMAIL PROTECTED]
> 
> -----------------------------------------------------------------------
> #include <stdio.h>
> #include <X11/Xlib.h>
> #include <X11/Intrinsic.h>
> #include <X11/StringDefs.h>
> #include <Xm/Label.h>
> 
> Arg args[] = {
>   XtNlabel, (XtArgVal) "Stuff",
> };
> 
> main(argc, argv)
> int argc;
> char **argv;
> {
>   Widget toplevel, wlabel;
>   WidgetClass wc;
>   int i;
> 
>   toplevel = XtInitialize(argv[0], "my-widget", NULL, 0, &argc, argv);
>   wc = xmLabelWidgetClass;
> 
>   i=0; 
>   wlabel = XtCreateWidget("mylabel",
>             wc,
>             toplevel,
>             args,
>             i);
> 
>   fprintf(stderr, "status of creating label widget %d\n", wlabel);
> 
>   XtRealizeWidget(toplevel);
>   XtMainLoop();
> }
> 
> 
> *************Compiled & linked using gcc version 3.0:
> gcc -o mytest mytest.c  /usr/X11R6/lib/libXt.so.6
> /usr/X11R6/lib/libXm.so.2.1 -L/usr/X11R6/lib -lX11
> 
> *************Executing, got the error:
> 
> X Error of failed request:  BadWindow (invalid Window parameter)
>   Major opcode of failed request:  19 (X_DeleteProperty)
>   Resource id in failed request:  0x0
>   Serial number of failed request:  92
>   Current serial number in output stream:  98
> 
> -----------------------------------------------------------------------
> 
> 
> _______________________________________________
> Xpert mailing list
> [EMAIL PROTECTED]
> http://XFree86.Org/mailman/listinfo/xpert

Paulo
_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to