Looks ok to me. Regards, Gary ----- Original Message ----- From: "Stéphane Ducasse" <stephane.ducasse@inria.fr> To: <Pharo-project@lists.gforge.inria.fr> Sent: Thursday, January 07, 2010 8:27 PM Subject: Re: [Pharo-project] Notifications of windows opening/closing/focus
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.
Yes I would be happy. I did not want to push this change because I could not assess the impact in term of slowdown. Now if we get an ok from gary and/or others this is ok for me.
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
what is the increment of notification because it can geenrate a lot of events?
- 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" <henrik.s.johansen@veloxit.no> To: <Pharo-project@lists.gforge.inria.fr> 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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project