Skip to content

Commit

Permalink
Merge pull request #575 from pharo-graphics/574-BlSpaceShownEvent-is-…
Browse files Browse the repository at this point in the history
…initialized-wrongly

Initialize BlSpaceShownEvent correctly
  • Loading branch information
tinchodias authored Aug 6, 2024
2 parents a5fe2d3 + 2a84ac9 commit cb4eecd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 5 additions & 3 deletions src/Bloc/BlParallelUniverse.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,7 @@ BlParallelUniverse >> openSpace: aSpace [
{ #category : #'private - spaces' }
BlParallelUniverse >> openSpaceSynchronously: aSpace [

aSpace isOpened
ifTrue: [ ^ self ].
aSpace isOpened ifTrue: [ ^ self ].

self
assert: [ aSpace hasHostSpace not ]
Expand Down Expand Up @@ -383,7 +382,10 @@ BlParallelUniverse >> openSpaceSynchronously: aSpace [

"Note: we should send shown event after everything else is done, because
theoretically, that only space could be closed as a reaction to the event"
aSpace dispatchEvent: (BlSpaceShownEvent new space: self).
aSpace dispatchEvent:
(BlSpaceShownEvent new
space: aSpace;
yourself).

"Notify root element that it is now visible to the user"
aSpace becomeVisible.
Expand Down
11 changes: 5 additions & 6 deletions src/Bloc/BlSpaceShownEvent.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ Example:
space := BlSpace new.
space
addEventHandlerOn: BlSpaceShownEvent
do: [ self inform: 'Space shown' ].
do: [ :anEvent | self inform: 'Space shown: ', anEvent space asString ].
space show
```
Note:
Behaves as SDL_WINDOWEVENT_SHOWN
"
Class {
#name : #BlSpaceShownEvent,
Expand All @@ -26,10 +23,12 @@ Class {

{ #category : #accessing }
BlSpaceShownEvent >> space [

^ space
]

{ #category : #accessing }
BlSpaceShownEvent >> space: anObject [
space := anObject
BlSpaceShownEvent >> space: aBlSpace [

space := aBlSpace
]

0 comments on commit cb4eecd

Please sign in to comment.