How do you get rid of that "Quit Pharo without saving message" that comes up when you try to close the Pharo window? I want to just let the user exit without any message or perhaps replace the message with one of my own.
|
The closing is intercepted in PasteUpMorph>>windowEvent: from where this is called WorldState>>quitSession | save | save := self confirm: 'Save changes before quitting?' translated orCancel: [ ^ self ]. save ifTrue: [Smalltalk snapshot: true andQuit: true] ifFalse: [Smalltalk snapshot: false andQuit: true] So you can change the method for example to WorldState>>quitSession Smalltalk snapshot: true andQuit: true (or snapshot: false if you don't want to save) Or you can close it by clicking on world menu and selecting "Save and quit". Peter On Thu, Apr 14, 2016 at 7:57 PM, kmo <[hidden email]> wrote: How do you get rid of that "Quit Pharo without saving message" that comes up |
Many thanks for that helpful and amazingly fast answer!
|
In reply to this post by Peter Uhnak
I did not really get it. Now I have the impression that changing the
method definition shows that Pharo does not
offer the correct possibility. Am I correct? Stef Le 14/4/16 20:58, Peter Uhnák a écrit :
|
I disagree. Closing the window should not decide on it's own whether the session should be saved. Asking the user is the right thing. The ideal thing would be to not ask if nothing has happened... but that's impossible, this is a live system, not a text editor. Peter |
Maybe he refers to the option to abort the close request programmatically in an event based approach.
Something like that UI close event is handled and triggers a "QuitSmalltalkRequested" event (or announcement) with a boolean value holder as argument, if no one handling such event/announcement vetoed the request, then it continues to normal shutdown. Dolphin Smalltalk uses that approach, see SessionManager >> queryEndSession at [1] Regards, Esteban A. Maringolo 2016-04-15 18:06 GMT-03:00 Peter Uhnák <[hidden email]>:
|
As a developer you need to be able to control the program shut down. That is a given.
I think I was expecting something like the Dolphin approach but it doesn't exist in pharo. Having to overwrite an existing method is not elegant but it works. A similar issue exists with Growl notifications - I have a post on this as well. |
What's Doplin's approach? Also adding a configuration option for this situation is rather trivial. On Sat, Apr 16, 2016 at 9:42 AM, kmo <[hidden email]> wrote: As a developer you need to be able to control the program shut down. That is |
The Dolphin approach was described by Estaban earlier in this thread. I've never used Dolphin myself so cannot expand on it.
|
Ah, right, that certainly sounds interesting. :) Pharo is yours, so you can add it. :) We already have a SystemAnnouncer so maybe it would be quite easy to add… it might be a nice exercise to get a bit more familiar with the system. Peter On Sat, Apr 16, 2016 at 11:01 AM, kmo <[hidden email]> wrote: The Dolphin approach was described by Estaban earlier in this thread. I've |
Pharo is yours, so you can add it. :) Yes, but I don't want to add it. I expect it to be there out of the box. I think it's quite enough work for me to add my own code on window close. I don't want to have to write the framework for doing it as well. |
On 16 April 2016 at 11:33, kmo <[hidden email]> wrote:
If you expect a perfect system out of the box, you will never get it.
Point is, it's not by design if the feature you're asking for is absent out of the box; nobody in Pharo decided you should HAVE to implement it yourself. I think everyone agrees that the platform should provide that feature, however everyone is focused on different issues, and you seem to be the first one for whom it's an itch worth scratching. It's open-source, so the system is yours too and it's the responsibility of everyone to improve it. If you really need the feature but don't want to implement it yourself, you could sponsor someone via the Pharo association or the consortium. |
Well, my reply was rather tongue-in-cheek. I was mocking my own laziness and the laziness of developers like me. But really I have no problem in doing these things for myself. And I hope that soon I will be in a position to contribute to pharo myself.
But overriding the close event is something any application developer is going to want to do. And every time you make a developer work harder than necessary to implement a basic feature you make the pharo platform less attractive. If you want more developers to use pharo you have to make basic things like this easy to do and easy to find out how to do. I do think that deployment of applications gets very little attention in pharo - yet it's a major issue of you want to make pharo a widely-used application platform. I'm not the only lazy developer, you know . |
In reply to this post by Damien Pollet-2
Or Bountysource or Bountysource Salt (https://salt.bountysource.com/teams/pharo). |
In reply to this post by kmo
2016-04-14 19:57 GMT+02:00 kmo <[hidden email]>: How do you get rid of that "Quit Pharo without saving message" that comes up Aboiut what are we talking ? The "Quit Pharo without saving message" is something I only see on the Windows platform. And for getting rid of this message, you can set EnableAltF4Quit=0 in Pharo.ini The Other message that exists is "Save changes before quitting" when selecting the "Quit" menu in Pharos world menu.
|
In reply to this post by Peter Uhnak
My point is that it is a proof that a library is not good when it
forces users to redefined core code.
Stef Le 15/4/16 23:06, Peter Uhnák a écrit :
|
In reply to this post by kmo
Le 16/4/16 11:33, kmo a écrit : > /Pharo is yours, so you can add it. :)/ > > Yes, but I don't want to add it. I expect it to be there out of the box. So you believe either is modern slavery or magic auto generation :D Seriously if you that need it are not ready to invest 30 min why me that does not need it should do it? Do you know what is free open-source software? > I think it's quite enough work for me to add my own code on window close. I > don't want to have to write the framework for doing it as well. > > > > -- > View this message in context: http://forum.world.st/Trapping-the-Pharo-window-close-event-tp4890079p4890283.html > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. > > |
In reply to this post by kmo
Le 16/4/16 12:18, kmo a écrit : > Well, my reply was rather tongue-in-cheek. I was mocking my own laziness and > the laziness of developers like me. But really I have no problem in doing > these things for myself. And I hope that soon I will be in a position to > contribute to pharo myself. But you are :) 30 min a week is enough :) > > But overriding the close event is something any application developer is > going to want to do. And every time you make a developer work harder than > necessary to implement a basic feature you make the pharo platform less > attractive. If you want more developers to use pharo you have to make basic > things like this easy to do and easy to find out how to do. We know that. Now I will not give the HUGE list of the things we are working on and that default developers are in need: - good file library - good list widget - FFI - decent texteditor - a compiler :) - ... > > I do think that deployment of applications gets very little attention in > pharo - yet it's a major issue of you want to make pharo a widely-used > application platform. Indeed. We started to push that when damien worked on the launcher and we should continue. > > I'm not the only lazy developer, you know . > > > > -- > View this message in context: http://forum.world.st/Trapping-the-Pharo-window-close-event-tp4890079p4890285.html > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. > > |
In reply to this post by kmo
Just for the record I am in agreement as I think most of us are about this. But....On Sat, Apr 16, 2016 at 1:51 PM kmo <[hidden email]> wrote: Well, my reply was rather tongue-in-cheek. I was mocking my own laziness and |
sorry meant to say Pharo is not lazy coder friendly by nature. On Fri, Apr 22, 2016 at 10:03 AM Dimitris Chloupis <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |