AIX tkined hangs with `bitmap "icon" not defined', cont.

Thomas R. Benjamin (thomasb@austin.ibm.com)
Thu, 3 Oct 1996 16:19:01 -0500 (CDT)

This is a continuation of an earlier thread regarding tkined
hanging after outputting <bitmap "icon" not defined> .

I have the same problem with undefined bitmaps on another RS6000,
this time running AIX 3.2. I compiled with gcc-2.5.8
instead of the native AIX compiler. I tried a couple of your test
suggestions.

Juergen> So we have three reports now all coming from AIX machines. Someone out
Juergen> there with this problem not running AIX?

Juergen> Note, the icon bitmap (and a couple of other bitmaps) are defined in
Juergen> the initialization procedure Tkined_Init() in the file tkiInit.c.
Juergen> There are a couple of calls to Tk_DefineBitmap() and I do not see why
Juergen> they seem to fail. Can someone please put some code into tkiInit.c to
Juergen> check the return code of Tk_DefineBitmap(). Or just print out the
Juergen> contents of interp->result after the call to Tk_DefineBitmap().
Juergen> (However, my understanding of the implementation of Tk_DefineBitmap()
Juergen> is that you only get an error if the bitmap is already defined. I am
Juergen> getting a bit confused.)

I inserted a printf code line in ../scotty-2.1.1/tkined/generic/tkiInit.c,
after the first call to Tk_DefineBitmap.

--> printf("interp->result = '%s'\n" , interp->result);

The result was a null value for interp->result.

I also inserted printf statements in ../tk4.1/generic/tkBitmap.c, within
the function Tk_GetBitmap(interp, tkwin, string). There are three
tests, each of which has a branch consisting of the statement:
goto error;
The code fragment below causes the goto error. The second <if>
is where the tkined error output <bitmap "icon" not defined> comes from.

if (predefHashPtr == NULL) {
/*
* The check for a NULL interpreter is a special hack that
* allows this procedure to be called from GetShadows in
* tk3d.c, where it doesn't have an intepreter handle.
*/

if (interp != NULL) {
Tcl_AppendResult(interp, "bitmap \"", string,
"\" not defined", (char *) NULL);
}
printf("Jumping to <error:> because <<interp != NULL>>\n");
goto error;

Juergen> BTW, the reason to define bitmaps in the C code is that they are used
Juergen> as a fallback if there are not bitmap files available at run-time.

I'll continue to try to ping down the problem, but I'm getting into
unfamiliar territory. Let me know where to attack next.
I'm trying to treat all bitmaps as references to files by catching
the bitmap name (in variable <string> and converting it to:
@PATH/name.xbm, then using it as an argument to XReadBitmapFile.
I doubt the side effects are worth the trouble though. Besides,
the fix should go in tkined and not Tk.

Thanks.
Tom

-- 
Thomas R. Benjamin
Integrated Systems and Solutions Corporation
Phone:  512.893.9359
E-Mail: thomasb@austin.ibm.com