[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: positioning the control panel window
From: |
Sven Thommesen |
Subject: |
Re: positioning the control panel window |
Date: |
Thu, 18 Sep 1997 15:20:08 -0500 |
OK, here's what I've done in my program (I have a huge ObserverSwarm by
now, and my app is in that peculiar state where it dumps core rather than
do anything useful, so I had to dig a bit.)
Data defined in ObserverSwarm.h:
ButtonPanel *cpWidget;
id ppdMS;
Frame *pdMS;
ZoomRaster *worldHeatRaster;
BLTGraph *unhappyGraph;
In ObserverSwarm.m / buildObjects:
// The control panel:
cpWidget = [controlPanel getPanel];
// Probe displays (as many as needed):
ppdMS = [ProbeDisplayManager createProbeDisplayFor: modelSwarm];
pdMS = [ppdMS getTopLevelFrame];
// Agent-attribute rasters (already created):
worldHeatRaster = [ZoomRaster create: [self getZone]]; // etc. ...
// Graph objects (already created):
unhappyGraph = [BLTGraph create: [self getZone]]; // etc. ...
I have not investigated the use of EZGraph objects with this.
Finally, if ObserverSwarm.m / placeWidgets,
which is called at the end of -buildActions, after my sim has halted a
couple of times to let me fiddle with probe values (yeah, before placement,
unfortunately):
-placeWidgets {
[ cpWidget setWindowGeometry: cpStr];
[ pdMS setWindowGeometry: msGstr];
[ worldHeatRaster setWindowGeometry: hrGstr];
[ unhappyGraph setWindowGeometry: uhGstr];
return self;
}
Those strings (msGstr) contain valid X geometry strings. It will take a bit
of fiddling to get placement right, especially if you have a virtual
desktop with several widows on it ...
I read those strings in along with the rest of the parameters, since I have
a different screeen layout at work and at home.
The only change to existing Swarm objects needed for this to work should be
adding the 'getTopLevelFrame' method to SimpleProbeDisplay and
CompleteProbeDisplay. All this method has to do is to 'return topLevel'.
Hope this works!
Sven
==================================
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.
==================================