Jump to content

Why I need to write exit for close button ?


Recommended Posts

This is no a problem. This is a query yo satisfy the burning mind.

Why I need to write 'exit' for close button, while minimize button works automatically?

I know that more code can be added to close,minimize,maximize,restore events ...

but the default action of each should be as normal windows behave.

Minimize button functions as normal without writing a single line of code ... but I have to write codes to make the close button effective. Why ?

Link to comment
Share on other sites

Although it has been a while since I wrote anything in AutoIt, I think you have something else going on in your script. I usually did not write any exit statements for the close button. So please post a simple sample proving your point.

Happy scripting ..:whistle:

Link to comment
Share on other sites

probably for convenience because some people may want their program to act differently when the X is pressed. For example, some people might want the whole program to Exit when it's pressed, while others might just want to hide the gui while still keeping the program running in the background. So users are able to do this because AutoIt has them write their own $GUI_MSG_CLOSE function.

Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

To give you the opportunity to make a function to run when you click the close button. Like save settings, note, files, etc.

Didnot I tell you that I know user can write custom functions on these events ? Check my first post.

I asked a different thing.

Why I need to write 'exit' for close button, while minimize button works automatically?

It means ... I need to write ...

GUISetOnEvent($GUI_EVENT_CLOSE, "close_fnc")

and added two buttons .. which on click show two different message... just that.

Edited by softhunterdevil
Link to comment
Share on other sites

Didnot I tell you that I know user can write custom functions on these events ? Check my first post.
Did I not tell you why? The Opportunity!

Why I need to write 'exit' for close button, while minimize button works automatically?

It means ... I need to write ...

GUISetOnEvent($GUI_EVENT_CLOSE, "close_fnc")

:whistle:

Edited by Mr. Zero
Link to comment
Share on other sites

Did I not tell you why? The Opportunity!

Because:

Func close_fnc()
    _RunMySaveFunction()
    Exit
    EndFunc

:P

You will never understand what you are not capable of. :whistle:

One can add custom script to minimize or maximize button... and he/she dont write code for minimizing or maximizing as they function by default.

Similarly ... instead of writing close script for close button ... close button should behave normally. User will only write their own functions to close button before exit.

May God help you !

Link to comment
Share on other sites

Lmao! :D

You might as well ask why bananas are curved.

Your question serves no purpose!

(offtopic but informative mode)

Though I agree with your literally and figuratively bold statement, I feel an uncontrollable urge to answer your first question. I have learned a long time ago that bananas are curved because the turgor in the banana shell (is shell the correct term?). Just like in all other growing plants, trees etc., the turgor contracts the cells when sun shines on it. But because a banana is too heavy to stand upright (like a plant or tree), it's own weight keeps it hanging down. The turgor in the banana shell is enough though to keep fruit itself curved. When bananas are grown by using artificial sunlight that comes from beneath, the bananas remain perfectly straight... :whistle:

BTW I guess this should be a sticky support topic! :P

(/offtopic but informative mode)

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

(offtopic but informative mode)

Though I agree with your literally and figuratively bold statement, I feel an uncontrollable urge to answer your first question. I have learned a long time ago that bananas are curved because the turgor in the banana shell (is shell the correct term?). Just like in all other growing plants, trees etc., the turgor contracts the cells when sun shines on it. But because a banana is too heavy to stand upright (like a plant or tree), it's own weight keeps it hanging down. The turgor in the banana shell is enough though to keep fruit itself curved. When bananas are grown by using artificial sunlight that comes from beneath, the bananas remain perfectly straight... :whistle:

BTW I guess this should be a sticky support topic! :P

(/offtopic but informative mode)

cool, thanks for the info.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...