Relaunching program
Pages: 1 2
Matthew Phillips (473) 721 posts |
There are a lot of excellent suggestions in this thread, but are these methods documented anywhere, or did most of us just come up with these ideas independently based on observation of other applications? |
nemo (145) 2546 posts |
Druck et al suggested variations of
As others have said, this is inflexible and destructive (consider This allows various things to be negotiated among instances including Dynamic Area names, hot keys and Scrap directories, and I commend it to the House. In particular, this allows instances to decide which should continue (the new one if it has command-line params such as a file to load; the old one if it’s still editing something; both if both these things are true) and the new instance could choose to hide its icon until the previous instance quits, masquerading as a multi-file program. |
Fred Graute (114) 645 posts |
Getting back to the original question, assuming it’s still relevant:
Would Filer_Run fit the bill? The first copy issues a Filer_Run to start a new copy of itself and then calls Wimp_CloseDown. The Filer_Run won’t be executed until control is returned to the Wimp by which time the first copy must have finished closing down. |
nemo (145) 2546 posts |
Good answer. The |
David J. Ruck (33) 1635 posts |
[Monitor task starting messages and sent quit to new task]
That’s not very likely unless your your data load message handling is broken so the filer has to drop back using the filetype alias.
That wont be an issue unless you change your locale between running each copy.
That is a good solution, but wasn’t around when I was writing most of my RISC OS stuff, more like 30 years ago now. |
Stuart Swales (8827) 1357 posts |
I think that I put commit-suicide-if-one-is-already-loaded into PipeDream 3 back when most of our users had floppies and impatiently double-clicked the application again. Perhaps I shall now remove the single-instance nonsense from PipeDream 4… |
nemo (145) 2546 posts |
It’s absolutely common for single-file editors. I have an ancient single-file editor that works the way I was describing – if it’s already on the Iconbar doing nothing when I double click on its App Dir, I don’t need another instance. But if it’s already editing something, then clearly I do need a new one. And @RunTypes are not only used by the Filer. They are a FileCore concept, so equally apply to Wimp_StartTask which does not bother with DTP niceties.
No criticism implied. We stand on the shoulders of giants, etc. |
nemo (145) 2546 posts |
Stuart surmised
The principle of least surprise is often forgotten. Also consider the American Customer Service Mantra – “Find a way to say ‘yes’”. |
Stuart Swales (8827) 1357 posts |
I looked at Fireworkz’ window handling code t’other day and pondered for a few seconds why it wasn’t using the Nested Window Manager to handle all the stacked document sub-windows, list boxes in dialogue boxes etc. Before I realised we didn’t have that back then, which is why Fireworkz has its own implementation.
Indeed, or JFDI |
nemo (145) 2546 posts |
Peeps forget that !Madness existed for a serious reason – testing your pane handling. These kids with their Nested Wimp don’t know they’re born! <climbs back into hole in road> |
Steffen Huber (91) 1953 posts |
And moving windows that happen to be positioned outside the visible area back into it. Such a useful tool :-) |
nemo (145) 2546 posts |
Interesting use! I wrote this in 1993 for similar reasons: |
Stuart Swales (8827) 1357 posts |
AAsm on the Desktop is a bit of a tease… always invoked it with Obey files! |
nemo (145) 2546 posts |
Was that not standard? It’s just FrontEnd. However, behind it is my patched AAsm that treats LEADR as a filetype if <=&FFF, so source can instruct it to make the right file. (why didn’t it always work like that) |
Pages: 1 2