Hi!
In the PharoTaskForces SqueakSource repository I committed a new
version of Morphic (Morphic-Alexandre_Bergel.393). This version
includes the window announcement I have been working on for few months
already.
Here is an example of a unit test.
-=-=-=-=-=-=-=-=-=-=-=-=
MorphicWindowNotificationTest>>testWindowCreationAndDeletion
| t window newWindowCreated r |
t := 0.
World announcer on: MorphicCreationWindowAnnouncement do: [:ann |
t := t + 1. newWindowCreated := ann window].
World announcer on: MorphicClosingWindowAnnouncement do: [:ann | t :=
t + 10. newWindowCreated := ann window].
window := SystemWindow labelled: 'foo'.
window openInWorld.
self assert: (t = 1).
self assert: (window == newWindowCreated).
window delete.
self assert: (t = 11).
self assert: (window == newWindowCreated).
-=-=-=-=-=-=-=-=-=-=-=-=
If everybody agrees on this, it would be cool to include it in Pharo
soon. At each new version of Morphic, I will have to update this, and
this is boring.
The comment of the .mcz is
-=-=-=-=-=-=-=-=-=-=-=-=
This new version extends Morphic with a window event mechanism.
It add a variables to SystemWindow (thus implies a recompilation of
all subclasses of SystemWindow).
It does some overrides in:
- SystemWindow: for deletion, resize, ...
- ScrollPane: notification for scrolling. This part is probably not
nicely designed, but it works
- PasteUpMorph: World can now emit event for window creation and
deletion
The method SystemWindow>>openAsIsIn: is overriden. The new version
belongs to Morphic, before it belonged to Polymorph. Loading this
version make Polymorph dirty therefore.
5 test methods are provided in MorphicWindowNotificationTest. All
tests are green in a pharo1.0-10502-rc1dev09.12.2
-=-=-=-=-=-=-=-=-=-=-=-=
Comments are welcome
Cheers,
Alexandre
On 7 Jan 2010, at 10:58, Gary Chambers wrote:
> Fair enough. Perhaps the "global" announcer could be accessed via the
> class-side of SystemWindow.
>
> Lots of evil ways of manipulating morphs too. Just thought about
> hide/show
> etc.
>
> Regards, Gary
>
> ----- Original Message -----
> From: "Henrik Johansen" <[email protected]>
> To: <[email protected]>
> Sent: Thursday, January 07, 2010 1:28 PM
> Subject: Re: [Pharo-project] Notifications of windows opening/
> closing/focus
>
>
>>
>> On Jan 7, 2010, at 2:10 04PM, Gary Chambers wrote:
>>
>>> That is one option, though it does seem to be burdensome on the
>>> announcement
>>> consumers to (depending upon requirements) possibly have to track
>>> all
>>> windows themselves.
>>>
>>> Regards, GaryI am not talking about Announcers, but where the
>>> Announcement is created.
>>
>> I'm not talking about letting the window be the announcer, but
>> where the
>> announcement is made.
>>
>> So you'd do
>> openAsIsIn: aWorld
>> "current implementation"
>> someAnnouncer announce: (WindowOpened for: self in: self world)
>>
>> someAnnouncer could be a global announcer for all window events.
>>
>> Cheers,
>> Henry
>> _______________________________________________
>> Pharo-project mailing list
>> [email protected]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project