ProjectViewMorph
Laurence.Rozier at knowledgearchitects.net
Laurence.Rozier at knowledgearchitects.net
Thu Sep 4 20:20:56 UTC 2003
>Thanks Laurence, I was a little slow this morning... I'm digging around a
>little more in the ProjectViewMorph and I was wondering how much work it would
>require to write a new method that opens ProjectViewMorphs as active. So
>instead of holding down the mouse button, all ProjectViewMorphs would open as
>ActiveSubprojects?
Not very much at all - just modify mouseUp: to send enterAsActiveSubproject instead of enter. However, you do NOT want to do that except for a temporary experiment as your change will be subject to being clobbered in a future release. If you want to really want to change the behavior of all ProjectViewMorphs, you'd have to come up with a way to make it pluggable with a default to the current behavior so that it could be integrated into the image without disruption. It's something that would be nice to have and would be a good way for you to practice Squeaking :-) If you're not interested in making all ProjectViewMorphs ever created behave this way then subclass ProjectViewMorph overriding mouseUp: and figure out where you have to create instances of the new subclass.
>
>My next question digs a little deeper... and is probably a little more
>difficult. I'd like to change the overall appearance of ActiveSubprojects -
>the coloured squares along the side don't give the user much idea of what the
>square will do when clicked. Any ideas on how to tackle a slight re-design?
I'm sure if you come up with a good design for this and implement it, it will be welcomed into the update stream.
>Or I could just stick with my little menu/legend that I've given the user.
>
>Thanks again for your help,
>Jeff
>
>
>Quoting Laurence.Rozier at knowledgearchitects.net:
>
>> >Just a quick newbie question for the Squeak experts... I'm trying to create
>> a
>> >button that uses enterAsActiveSubproject to open a project in active mode.
>> I
>> >have all of my ProjectViewMorphs in the world... but my question is - how
>> do I
>> >refer to these morphs when creating my button? The ProjectViewMorphs exist
>> in
>> >the world already, so it's not like I'm initializing new morphs - or is that
>>
>> >what I should be doing?
>>
>> Sending a enterAsActiveSubproject message to a ProjectViewMorph is *one* way
>> to accomplish what you want. You can refer to these morphs a number of ways
>> depending on what state your code has access to. For example you can use
>> submorphsSatisfying: aBlock or submorphNamed: aProjectName. However if you
>> have aProjectName then you could also say
>>
>> (Project named: aProjectName) enterAsActiveSubprojectWithin: World
>>
>> which will allow you to enter projects that don't have ProjectViewMorphs in
>> the current world.
>>
>> Regards,
>> Laurence
>
>
>
>
More information about the Squeak-dev
mailing list
|