swarm-support
[Top][All Lists]
Advanced

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

Re: problem with raster


From: mcmullin
Subject: Re: problem with raster
Date: Thu, 6 Mar 1997 15:14:05 -0700 (MST)

On  6 Mar, Kevin Crowston wrote:
> I'm trying to draw a network on a Raster widget.  I'm running into a few
> problems.
[...]
> 
> The major problem is the getHeight and getWidth always return 3 instead of
> the actual height and width of the Raster.  I tried intercepting these
> calls using gdb to return 300 instead of 3 and it worked okay.  Clearly
> this isn't a problem for Heatbug, but I'm not sure what I'm doing
> differently or not doing right.


Funnily enough I ran into this precise thing just
yesterday.  I have not investigated carefully enough
yet, but it seems that Raster simply inherits getHeight
& getWidth from Widget (whereas, it overrides
setWidth:Height: which seems a bit suspicious).
Anyway, I hacked my local Raster.m (i.e. I made a copy
local to my app) and added the following code:

-(unsigned) getWidth {
  return width;
}

-(unsigned) getHeight {
  return height;
}

This overrides the Widget methods and returns values
taken from Raster specific instance vars.  This
*seemed* to fix the problem for me - your mileage may
vary!  And, of course, it needs more work to decide
whether this is really the "correct" thing to do...

- Regards,

Barry.

-- 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| Barry McMullin, ALife Group,               |    address@hidden |
| Santa Fe Institute, 1399 Hyde Park Road,   |  Voice: +1-505-984-8800 |
| Santa Fe, NM 87501, USA.                   |  FAX:   +1-505-982-0565 |
| http://www.eeng.dcu.ie/~mcmullin           |                         |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




reply via email to

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