For icons in trees in VisualWorks you should:
(1) have a look at the class ListIconLibrary
(2) make extensions on this class to keep your icons in (just take some
existing ones as example)
suppose you choose myIcon20x20, and myIcon20x20mask
(3) you can then get this icon with the method #visualFor: #myIcon
which will use your picture and the mask to produce a transparant icon.
In the original StarBrowser I do this to have all kinds of icons in the
If you want a more detailed example where your application controls
really everything you can have a look at StarBrowser2, where I install
custom visual blocks, like what you would do with a list.
Just send me a mail with what you want to do exactly in case you have
no idea what I'm talking about and I'll either do it or give you more
detailed instructions. I don't know how proficient you are with this
:-) In the meantime I figured it out :-)
On 26 Jul 2004, at 13:54, Lukas Renggli wrote:
would be much better. I'm working on a better
the tree, which use some icons for the nodes, for plus and minus, to
a nicer design than using unordered lists. So there will be a lot of
small images now... How can I hold these images within the code?
Sure, but I don't really know how to do it VisualWorks in a
(preferably) portable manner.
added a space into the tree component before the label. This is
the responsibility of the CSS-Stylesheet. No layout information in
Smalltalk code. Not even a single space :)
*g* ok, I get that. As mentioned above, the tree implementation I
prefer to have, uses images now, so it ain't be possible to discard
layout information from the Smalltalk code. To set an image in the
should be okay, no? ;)
Images should be part of the CSS as well, I think. So if you have a
green style enabled, you maybe want to have the tree-buttons in blue
as well. I would suggest to keep all the component layout to a very
minimal string-based css-enabled rendering and add images, colors,
etc. using style-sheets.
suspect you didn't understand the idea of RelatedComponent. Why
you have for all your subclasses two almost identical method-bodies
like #structures and #search...?
yes, you're right, that's bad...
Mhh ... well, maybe my superclass RelatedComponent isn't very useable,
e.g. for external links you cannot return a structure. Maybe the
method should be #links and return a collection of link instances,
that can be anything: mail, url, structure, broken, valid, etc.
component should consist only of a configurable title-string
by BodyComponent) and all the necessary information within div, span,
ul, li, etc tags.
okay, that's better, I see. I have already worked on a CSS-Stylesheet
the new user interface, but I have not finished it so far. You can
from the university server. So I will try to control all the layout
with this CSS file. Should I place this file also within the Smalltalk
code somewhere, or is better the store it externaly?
I don't know yet, maybe we should discuss. Nothing providing
CSS-Styles is there yet. Seaside is having some functionality, so
maybe we want to build something on top there.
roel.wuyts(a)ulb.ac.be Université Libre de
Board Member of the European Smalltalk User Group: