Page 1 of 3

From Minimize to Maximize the Lasagna with LC (='.'=) [SOLVED]

Posted: Thu May 03, 2018 4:04 pm
by Mariasole
While I enjoy experimenting with LiveCode, I sometimes cook lunch or dinner.
So I thought of doing a small application to avoid burning lasagna or meat sauce (ragù, bolognese).

I thought to make a small stand alone where I put a number of minutes and, when the time is up, a colored window will come out on my computer with a message, for example "the dinner burns!". :shock: :shock: :shock:

I give a summary to better explain it, :oops: Mah scots is indeed ill ! (richmond62 docet) :wink:

a) I'm working on the computer (desktop with Windows)
b) I turn on my little program (standalone) and I set the minutes
c) I MINIMIZE the small program (because I have to keep working)
d) when the minutes have expired the program IS ALARM, REMOVES ITS MINIMIZATION, MAXIMIZES, ABOVE ALL WINDOWS AND SHOW!
Sorry for uppercase, (and for my ridiculous English) but it is to highlight the highlights. :!:

Now, I can do everything (ie the "countdown", the colored window, the standalone, etc.).

What I do not know how to do (and I have searched the vocabulary but I can not find the solution) is, once the time has elapsed, to maximize the window that is minimized (or under all other windows).

Do you believe that it can be done with LC?

Thank you guys!

Mariasole
(='.'=)

Re: From Minimize to Maximize the Lasagna with LC (='.'=)

Posted: Thu May 03, 2018 4:21 pm
by bogs
Assuming (bad habit of mine) that your minutes are in a variable of some kind, I think it would be something a handler like (not tested psuedo code)

Code: Select all

// at the end of the handler that starts your timer / iconifies the stack...
on timerFinished
	if theMins = 1 then show stack "myAlarmStack"
	send to me in 30 seconds 
// or whatever amount of time you deem necessary...
end timerFinished

Re: From Minimize to Maximize the Lasagna with LC (='.'=)

Posted: Thu May 03, 2018 4:56 pm
by Mariasole
Grazie davvero gattone!
The reasoning is perfect, even I imagined it that way.
The problem is the "command" since "show me" does nothing in the minimized standalone....
I do not know what command to put.

Code: Select all

if tTime is "0" then

MAXIMIZE THE WINDOW AND PUT IN FRONT OF ALL :)

end if
:? mmmmmmmmm....

Re: From Minimize to Maximize the Lasagna with LC (='.'=)

Posted: Thu May 03, 2018 5:13 pm
by Klaus
Ciao cara,

this property is what you are looking for:

Code: Select all

...
## Maximize window:
set the iconic of this stack to FALSE
...
Best

Klaus

Re: From Minimize to Maximize the Lasagna with LC (='.'=)

Posted: Thu May 03, 2018 5:21 pm
by Mariasole
Thank you Klaus! It works!!!

But if the window was not minimized but hidden behind other windows, how can I tell the window:

Code: Select all

Hey! stand in front of all the windows!
Thank you very much, you deserve the tagliatelle alla bolognese (handmade) :D

Re: From Minimize to Maximize the Lasagna with LC (='.'=)

Posted: Thu May 03, 2018 5:31 pm
by Klaus
Ciao cara,

grazie, adoro la pasta! :-)

I'm fraid you can do this only with AppleScript on a Mac and VBScript on Windows.
AppleScript example, put this snippet into a custom property or a field

Code: Select all

tell application "XXXX"
   activate
end tell
Then replace XXXX with the name of your standalone (or the current running verwsion of LC, if this should work in the IDE) and "do IT as AppleScript", capisce?

Being a Mac guy, I'll leave the Windows part up to you. :-)


Best

Klaus

Re: From Minimize to Maximize the Lasagna with LC (='.'=)

Posted: Thu May 03, 2018 5:56 pm
by Lagi Pittas
Hiya

Code: Select all

On TimerDone
   --Bring to Front
   set the systemwindow of  stack "timerdone" to TRUE
   wait 250
   -- Then don't make it a system window otherwise it will be above all the others all the time
   set the systemwindow of  stack "timerdone" to false
end TimerDone
I used this in an application that was loading another version of itself with a different name - I just tested it with a test stack

Regards Lagi

Re: From Minimize to Maximize the Lasagna with LC (='.'=)

Posted: Thu May 03, 2018 6:05 pm
by Klaus
Ah, yes, "systemwindow", never used it, always forget about it :-)

Re: From Minimize to Maximize the Lasagna with LC (='.'=) [SOLVED]

Posted: Thu May 03, 2018 6:06 pm
by Mariasole
Grazie Lagi!!!!
I had also found this solution and I was posting it.

Code: Select all

 set the systemWindow of stack "TimerDinner" to true
And here the good Lagi gave it to me too! :D

Thank you very much!

Grazie Klaus, anche io una volta ero un'utente Apple! Bei tempi! :)
Grazie gattone Bogs! Sei sempre carinissimo!


Mariasole
(='.'=)

Re: From Minimize to Maximize the Lasagna with LC (='.'=) [SOLVED]

Posted: Thu May 03, 2018 8:22 pm
by bogs
@ Lagi - Wow, nice Lagi, thank you for that!
@ Klaus - I should have known, I must have hit a blank spot :oops:

Re: From Minimize to Maximize the Lasagna with LC (='.'=) [SOLVED]

Posted: Thu May 03, 2018 9:29 pm
by richmond62
cook.jpg
COOKING.livecode.zip
Here's the stack.
(88.7 KiB) Downloaded 307 times

Code: Select all

on mouseUp
   ask "Time in minutes?"
   put it into MINZ
   put (MINZ * 60) into SEX
   set the width of stack "COOKING" to 2
   set the height of stack "COOKING" to 2
   set the loc of stack "COOKING" to -10,-10
   wait SEX secs
   set the width of stack "COOKING" to 1024
   set the height of stack "COOKING" to 780
   set the loc of stack "COOKING" to the screenLoc
end mouseUp

Re: From Minimize to Maximize the Lasagna with LC (='.'=) [SOLVED]

Posted: Fri May 04, 2018 5:42 am
by bogs
LOL @ Richmond :lol:

Re: From Minimize to Maximize the Lasagna with LC (='.'=) [SOLVED]

Posted: Fri May 04, 2018 11:34 am
by Lagi Pittas
Richmond for boiling an egg (and other things) it can be optimized.

Code: Select all

put 3 into MINZ 
Lagi

Re: From Minimize to Maximize the Lasagna with LC (='.'=) [SOLVED]

Posted: Fri May 04, 2018 12:27 pm
by richmond62
for boiling an egg
Hard or soft?

Re: From Minimize to Maximize the Lasagna with LC (='.'=) [SOLVED]

Posted: Fri May 04, 2018 12:32 pm
by Klaus
Cook yourself an egg with Lagi's setting, peel it and try to slice it.
That should answer your question! :D