Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pharo smalltalk Window closing

I am using Pharo Smalltalk version 4.0 to build a simple GUI app. I wish to make sure that "StandardWindow" that I have created does not close when the user clicks on 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 click on the "X" button. Any ideas about what am I missing? Any help will be greatly appreciated.

like image 868
user5163359 Avatar asked Dec 20 '25 20:12

user5163359


1 Answers

The method mustNotClose is only an accessor for checking that the instance variable mustNotClose is set to true:

mustNotClose
    ^ mustNotClose == true

You should use the method makeUnclosable that actually deletes the close button. You can then add the close button back using makeClosable.

like image 175
Andrei Chis Avatar answered Dec 24 '25 11:12

Andrei Chis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!