Closing the pharo smalltalk window

I am using Pharo Smalltalk version 4.0 to create a simple GUI. I want to make sure the "StandardWindow" I created doesn't close when the user clicks the "X" button in the top corner. Hence, I am sending the message "mustNotClose" to my window object, which is an instance variable of the superclass SystemWindow. However, the window still closes when I press the "X" button. Any ideas what I am missing? Any help would be greatly appreciated.

+3


source to share


1 answer


The method mustNotClose

is only accessorized to check that the instance variable is mustNotClose

set to true:

mustNotClose
    ^ mustNotClose == true

      



You should use a method makeUnclosable

that actually removes the close button. Then you can add a close button with makeClosable

.

+5


source







All Articles