swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Trying to fix longstanding bug: setWindowGeometryRecordName


From: Paul Johnson
Subject: Trying to fix longstanding bug: setWindowGeometryRecordName
Date: Wed, 02 Feb 2000 16:38:40 -0600

Since the "testing" version of Swarm gives a runtime error when you send
a message to nil, a program I was using before with a bug will not run
any more and I'm just stumped how to make it work.  I've been ignoring
this error a long time, but now I have to confront it.

In the ObserverSwarm, the buildObject method generates a number of
rasters, and names each one separately.  It is the usage of
setWindowGeometryRecordName that is causing tcl errors as well as the
message to nil crash. 

Here is the error output from console
(Tcl -eval:) bad window path name "(null)"
    while executing
"wm title (null) "feature00""
while evaluating: wm title (null) "feature00"
(Tcl -eval:) bad window path name "(null)"
    while executing
"wm title (null) "feature01""
while evaluating: wm title (null) "feature01"
(Tcl -eval:) bad window path name "(null)"
    while executing
"wm title (null) "feature02""
while evaluating: wm title (null) "feature02"
(Tcl -eval:) bad window path name "(null)"
    while executing
"wm title (null) "feature03""
while evaluating: wm title (null) "feature03"
(Tcl -eval:) bad window path name "(null)"
    while executing
"wm title (null) "feature04""
while evaluating: wm title (null) "feature04"
*** event raised for error: InvalidArgument
*** function: nil_method(), file:
/usr/local/src/redhat/BUILD/swarm-2.0.1.991201/src/defobj/internal.m,
line: 500
The message `setWindowGeometryRecordName:' was sent to nil.
*** execution terminating due to error
/usr/local/src/redhat/BUILD/swarm-2.0.1.991201/src/defobj/Symbol.m:173
-[Error(c) _raiseEvent:]


Here is the loop that creates the rasters and names them:

  rasterList = [List create: self];
  featureDisplayList = [List create: self];

  for(i=0; i<[Citizen getNumCultureFeatures] ; i++)
    {
      char rasterName[20];
   
      sprintf(rasterName,"feature%02d",i);
      worldRaster = [ZoomRaster createBegin: self];

      [worldRaster setWindowTitle: rasterName];
      [worldRaster setWindowGeometryRecordName: rasterName ];

      //     [worldRaster setWindowTitle: strdup(rasterName)];          
//I thought strdup would fix this, but it didn't
      //     [worldRaster setWindowGeometryRecordName:
strdup(rasterName)];
      worldRaster = [worldRaster createEnd];
      [worldRaster setColormap: colormap];
      [worldRaster setZoomFactor: 4];

      [worldRaster enableDestroyNotification: self
                   notificationMethod: @selector (_worldRasterDeath_:)];
   
      [worldRaster setWidth: [[modelSwarm getPositionGrid] getSizeX]
                   Height: [[modelSwarm getPositionGrid] getSizeY]];
      [worldRaster pack];                                 // draw the window.
      [rasterList addLast: worldRaster];

      // Now create a Value2dDisplay: this is a special object that will
      // display arbitrary 2d value arrays on a given Raster widget.
  
      featureDisplay = [Object2dDisplay createBegin: self];
      [featureDisplay setDisplayWidget: worldRaster];
      [featureDisplay setDiscrete2dToDisplay: [modelSwarm
getPositionGrid]];
      [featureDisplay setObjectCollection: [modelSwarm getCitizenList]
];
      [featureDisplay setDisplayMessage: M(drawSelfOn:)];

      featureDisplay = [featureDisplay createEnd];
      [featureDisplayList addLast: featureDisplay];

    }



-- 
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]