SimpleHierarchicalListMorph - current selection not highlighting
Matej Košík
kosik at fiit.stuba.sk
Mon Nov 28 09:42:45 UTC 2005
On Sun, 2005-11-27 at 17:30 -0500, Steve Greenberg wrote:
> Hi again. Still having fun building my app, but the
> SimpleHierarchicalListMorph is giving me some trouble.
>
> I've created my list using PluggableListItemMorph instances and it
> mostly does what I expect, except that the list doesnt highlight the
> currently selected item. I see that the list has #highlightSelection,
> which is supposed to call #highlightingColor on the list item. For
> some reason, though, #highlightSelection only seems to be called at
> list create an not when the selection changes.
>
> Anybody have an idea why? Is there some flag I'm supposed to set that
> tells it to highlight?
I have had exactly the same problem with highlighting the currently
selected item. Later I have found out some solution. It can be observed
in (from my viewpoint funny) project `GentzenCalculus'...
I have used this kind of morph for convenient displaying of proof-trees
of any given tautological sequent.
Here are some pictures:
http://altair.dcs.elf.stuba.sk/wiki/Kosik/GentzenCalculus#ExampleProofTrees
If you load `GentzenCalculus' to your image and run for example
ProofTreeMorph openFromString: '{~(a v b) => ~a & ~b}'.
or
ProofTreeMorph openFromString: '{~(a & b) => ~a v ~b}'.
appropriate (I call them left) proof-trees pop-up. *You will be able to
select various nodes, collapse and expand them*. I guess that might be
your problem. Initialization of the SimpleHierarchicalListMorph in my
code was done as follows:
proofTreeMorph := super new rootProofNode: aProofNode.
simpleHierarchicalListMorph := (SimpleHierarchicalListMorph
on: proofTreeMorph
list: #initialProofNodeList
selected: #getSelectedProofNode
changeSelected: #setSelectedProofNodeTo:
menu: nil
keystroke: nil)
setSelectionIndex: 1;
expandAll;
setSelectionIndex: 0.
Maybe you will be able to do something analogous for your kind of tree.
Regards,
--
Matej Košík
More information about the Squeak-dev
mailing list
|