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

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Mariasole
Posts: 218
Joined: Tue May 07, 2013 9:38 pm

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

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!".

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

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
(='.'=)
Last edited by Mariasole on Thu May 03, 2018 6:07 pm, edited 1 time in total.
No input, no output. Man - Joe Strummer
Garbage in, garbage out (GIGO) - anonymous

bogs
Posts: 3460
Joined: Sat Feb 25, 2017 10:45 pm

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

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
``````

Mariasole
Posts: 218
Joined: Tue May 07, 2013 9:38 pm

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

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....
No input, no output. Man - Joe Strummer
Garbage in, garbage out (GIGO) - anonymous

Klaus
Posts: 11009
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

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

Mariasole
Posts: 218
Joined: Tue May 07, 2013 9:38 pm

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

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)
No input, no output. Man - Joe Strummer
Garbage in, garbage out (GIGO) - anonymous

Klaus
Posts: 11009
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

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

Lagi Pittas
VIP Livecode Opensource Backer
Posts: 327
Joined: Mon Jun 10, 2013 1:32 pm

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

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

Klaus
Posts: 11009
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Ah, yes, "systemwindow", never used it, always forget about it

Mariasole
Posts: 218
Joined: Tue May 07, 2013 9:38 pm

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

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!

Thank you very much!

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

Mariasole
(='.'=)
No input, no output. Man - Joe Strummer
Garbage in, garbage out (GIGO) - anonymous

bogs
Posts: 3460
Joined: Sat Feb 25, 2017 10:45 pm

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

@ Lagi - Wow, nice Lagi, thank you for that!
@ Klaus - I should have known, I must have hit a blank spot

richmond62
Livecode Opensource Backer
Posts: 3334
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

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

COOKING.livecode.zip
Here's the stack.

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``````

bogs
Posts: 3460
Joined: Sat Feb 25, 2017 10:45 pm

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

LOL @ Richmond

Lagi Pittas
VIP Livecode Opensource Backer
Posts: 327
Joined: Mon Jun 10, 2013 1:32 pm

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

Richmond for boiling an egg (and other things) it can be optimized.

Code: Select all

``put 3 into MINZ ``
Lagi

richmond62
Livecode Opensource Backer
Posts: 3334
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

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

for boiling an egg
Hard or soft?

Klaus
Posts: 11009
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Cook yourself an egg with Lagi's setting, peel it and try to slice it.