IonicWind Software

IWBasic => The Roundtable => Topic started by: Brian on February 06, 2018, 07:48:40 AM

Title: Disabling the X in a titlebar
Post by: Brian on February 06, 2018, 07:48:40 AM
I obviously have nothing better to do. But scrabbling about through my old code, I saw this. It prevents a window being closed by pressing the X button. After a bit of calafudging . . .

When you first run it, you can close the window by pressing X or the Close button

Run it again. When you click the 'Disable X' button you can't close the window - only by pressing the 'Close' button

Enable it again by pressing the 'Enable X' button

(Sorry, Andy!)

Brian

Title: Re: Disabling the X in a titlebar
Post by: Andy on February 09, 2018, 05:43:46 AM
Brian,

Don't worry about it! - it's a nice bit of code.

Anyway, I could easily do it with my custom window, I would just need to add back in a maximise box. As you've seen, I know when you are clicking the close box in a custom window, so it would be easy to get the same effect.

Andy.