[Q][Newbie] disappearing dependents?
willem van den ende
squeak at willemvandenende.com
Fri Nov 14 11:13:44 UTC 2003
Hi,
Cees de Groot recently told me about the progress Squeak has made in the past
1.5 years since I last checked it out. I must say performance looks much
improved (it runs much smoother under linux now), it is quite stable,
SqueakMap is great, and I appreciate a much leaner default image. Thanks to
all involved!
As an exercise to try out various aspects of working with Squeak, I decided to
make an RSS Client in Squeak, so I can follow blogs from my colleagues from
within Squeak. So far I have managed to parse XML (that was easy with SUnit
and the SAXParser), show titles from blog entries in a PluggableListMorph and
use Scamper's WebPage pane to display the content of an entry.
Now I am stuck with updating the WebPage when clicking in the
PluggableListMorph. I stole some code from a tutorial, using the observer
pattern with #changed: and #update: so I can tell Scamper to redisplay the
page when the user clicks on another title. The frustrating thing is: it
works _sometimes_ - I must be making a silly mistake somewhere. It especially
stops working after I save the image. If I inspect the dependents of my
RssModel in the method where I add the dependent, it works more often (but
still not after saving the image with the RssViewer open).
I tried several things (including googling for some more info, filing out my
code and reloading it into a fresh 3.6g image, using a Model subclass and not
using one), but now I'm fresh out of ideas. Any help would be greatly
appreciated. Below is the method that opens the window, and a link to the
full source code, in case anyone is interested.
open
| window titlesMorph model |
rss _ RssHandler parseDocumentFromFileNamed: 'index.rss'.
model _ RssModel new.
model items: rss items.
self rss: model.
model addDependent: self.
model dependents inspect.
titlesMorph _ PluggableListMorph
on: model
list: #items
selected: #select
changeSelected: #select:.
scamper _ Scamper new.
window _ (SystemWindow labelled: 'RSS viewer')
addMorph: titlesMorph
frame: (0 @ 0 extent: 1 @ 0.2);
addMorph: scamper webContentsPane
frame: (0 @ 0.2 extent: 1 @ 0.8).
window openInWorld
http://www.willemvandenende.com/RssClient.st
cheers,
--
Willem van den Ende - http://www.cq2.nl
Meet CQ2 at XP-DAY Benelux http://www.xpday.nl
More information about the Squeak-dev
mailing list
|