[comp.windows.x] Help me application shell and Athena widgets, please

ted@mbunix.mitre.org (Edward J. Ede) (09/05/89)

I'm trying to write a talk-like utility and I'm having some problems
with Athena Widgets.  I have an application that opens a display on
the local host and the remote workstation(s).  It creates a text and
label widget for each talker.  

When I try to realize the widgets I get a BadCursor error from
X_Create_Window.  This problem manifests itself when I talk between
two machines running different window managers (awm and uwm).  It
works OK when I talk on the same machine (not very useful).  I guess a
window of one of the widgets is inheriting a cursor that doesn't
exist, but I'm not sure what to do about it.

Here's a skeleton:

- set up:
   XtToolkitInitialize
   XtCreateApplicationContext

- Create displays (and maintain a list) for each talker with:
    talker[i].display = XtOpenDisplay  /*with no special args*/

- Create a top-level widget on each display 
    talker[i].main_wid = XtAppCreateShell(unique_name,"Talk",
		     applicationShellWidgetClass,
                     talker[i].display,args,n)
    /* arg list is empty */

- Create widgets (this works ok)
    create a managed form widget under the main widget
    create text and label widgets under the form widget

- Realize widgets (this bombs)
   XtRealizeWidget(talker[i].main_wid);


Here's the error:
X Protocol error:  BadCursor, invalid Cursor parameter
  Major opcode of failed request:  1 (X_CreateWindow)
  Minor opcode of failed request:  24
  Resource id in failed request:  0x500007
  Serial number of failed request:  60
  Current serial number in output stream:  70


I also tried using a topLevelShellWidget, but to no avail.  Am I
missing something blatant, or is this a common problem of neophite
X programmers.

Any help would be greatly appreciated,
Ted 

|Ted Ede -- ted@mbunix.mitre.org -- The MITRE Corporation -- Burlington Road|
| linus!mbunix!ted -- Bedford MA, 01730 -- Mail Stop B090 -- (617) 271-7465 |
|                   - this line intentionally left blank -                  |
+---------------------------------------------------------------------------+

ted@mbunix.mitre.org (Edward J. Ede) (09/08/89)

I'm sorry if everyone has seen this before, but I'm not sure that it
made it to the net.

----

I'm trying to write a talk-like utility and I'm having some problems
with Athena Widgets.  I have an application that opens a display on
the local host and the remote workstation(s).  It creates a text and
label widget for each talker.  

When I try to realize the widgets I get a BadCursor error from
X_Create_Window.  This problem manifests itself when I talk between
two machines running different window managers (awm and uwm).  It
works OK when I talk on the same machine (not very useful).  I guess a
window of one of the widgets is inheriting a cursor that doesn't
exist, but I'm not sure what to do about it.

Here's a skeleton:

- set up:
   XtToolkitInitialize
   XtCreateApplicationContext

- Create displays (and maintain a list) for each talker with:
    talker[i].display = XtOpenDisplay  /*with no special args*/

- Create a top-level widget on each display 
    talker[i].main_wid = XtAppCreateShell(unique_name,"Talk",
		     applicationShellWidgetClass,
                     talker[i].display,args,n)
    /* arg list is empty */

- Create widgets (this works ok)
    create a managed form widget under the main widget
    create text and label widgets under the form widget

- Realize widgets (this bombs)
   XtRealizeWidget(talker[i].main_wid);


Here's the error:
X Protocol error:  BadCursor, invalid Cursor parameter
  Major opcode of failed request:  1 (X_CreateWindow)
  Minor opcode of failed request:  24
  Resource id in failed request:  0x500007
  Serial number of failed request:  60
  Current serial number in output stream:  70


I also tried using a topLevelShellWidget, but to no avail.  Am I
missing something blatant, or is this a common problem of neophite
X programmers.

Any help would be greatly appreciated,
Ted 

|Ted Ede -- ted@mbunix.mitre.org -- The MITRE Corporation -- Burlington Road|
| linus!mbunix!ted -- Bedford MA, 01730 -- Mail Stop B090 -- (617) 271-7465 |
|                   - this line intentionally left blank -                  |
+---------------------------------------------------------------------------+

envbvs@epb2.lbl.gov (Brian V. Smith) (09/10/89)

In article <67638@linus.UUCP> ted@mbunix.mitre.org (Ede) writes:
< I'm trying to write a talk-like utility and I'm having some problems
< with Athena Widgets.  I have an application that opens a display on
< the local host and the remote workstation(s).  It creates a text and
< label widget for each talker.  
< 
< When I try to realize the widgets I get a BadCursor error from
< X_Create_Window.  This problem manifests itself when I talk between
< two machines running different window managers (awm and uwm).  It
< works OK when I talk on the same machine (not very useful).  I guess a
< window of one of the widgets is inheriting a cursor that doesn't
< exist, but I'm not sure what to do about it.
< 
...
< 
< Here's the error:
< X Protocol error:  BadCursor, invalid Cursor parameter
<   Major opcode of failed request:  1 (X_CreateWindow)
<   Minor opcode of failed request:  24
<   Resource id in failed request:  0x500007
<   Serial number of failed request:  60
<   Current serial number in output stream:  70
< 
< 

The problem is in the Xmu file StrToCurs.c in caching the cursors.
It doesn't keep a separate cache table for each display.
The following patch will make it work until R4 comes out.
The patch was kindly provided by Ralph Swick of Project Athena.

Comment out the following line in the file lib/Xmu/StrToCurs.c

 	    /* if (!cache->cursor) */
_____________________________________
Brian V. Smith    (bvsmith@lbl.gov)
Lawrence Berkeley Laboratory
I don't speak for LBL, these non-opinions are all mine.

envbvs@epb2.lbl.gov (Brian V. Smith) (09/13/89)

 
< I'm sorry if everyone has seen this before, but I'm not sure that it
< made it to the net.


In article <67638@linus.UUCP> ted@mbunix.mitre.org (Ede) writes:
< I'm trying to write a talk-like utility and I'm having some problems
< with Athena Widgets.  I have an application that opens a display on
< the local host and the remote workstation(s).  It creates a text and
< label widget for each talker.  
< 
< When I try to realize the widgets I get a BadCursor error from
< X_Create_Window.  This problem manifests itself when I talk between
< two machines running different window managers (awm and uwm).  It
< works OK when I talk on the same machine (not very useful).  I guess a
< window of one of the widgets is inheriting a cursor that doesn't
< exist, but I'm not sure what to do about it.
< 
...
< 
< Here's the error:
< X Protocol error:  BadCursor, invalid Cursor parameter
<   Major opcode of failed request:  1 (X_CreateWindow)
<   Minor opcode of failed request:  24
<   Resource id in failed request:  0x500007
<   Serial number of failed request:  60
<   Current serial number in output stream:  70
< 
< 

The problem is in the Xmu file StrToCurs.c in caching the cursors.
It doesn't keep a separate cache table for each display.
The following patch will make it work until R4 comes out.
The patch was kindly provided by Ralph Swick of Project Athena.

Comment out the following line in the file lib/Xmu/StrToCurs.c

 	    /* if (!cache->cursor) */

_____________________________________
Brian V. Smith    (bvsmith@lbl.gov)
Lawrence Berkeley Laboratory
I don't speak for LBL, these non-opinions are all mine.