SetWindowModified

I know this has been discussed before but I can’t seem to locate the conversation now. Some of my older projects set the dot in the red button of the title bar (indicating unsaved changes) by using a function that included this:

#if TargetCarbon then Declare Function SetWindowModified Lib "carbon" (window As WindowPtr, modified As Integer) As Integer #else Declare Function SetWindowModified Lib "InterfaceLib" (window As WindowPtr, modified As Integer) As Integer #endif

This doesn’t work anymore. Can someone suggest another method for doing this?

Have a look at http://documentation.xojo.com/index.php/Window.ContentsChanged_property. That should do it.

[quote=408772:@Michael Gibbs]I know this has been discussed before but I can’t seem to locate the conversation now. Some of my older projects set the dot in the red button of the title bar (indicating unsaved changes) by using a function that included this:

#if TargetCarbon then Declare Function SetWindowModified Lib "carbon" (window As WindowPtr, modified As Integer) As Integer #else Declare Function SetWindowModified Lib "InterfaceLib" (window As WindowPtr, modified As Integer) As Integer #endif

This doesn’t work anymore. Can someone suggest another method for doing this?[/quote]
Welcome to the world of macOS development, both of those frameworks were deprecated a long time ago. Thankfully the function you want is supported by Xojo and baked right into the language.

Even better! Thanks guys.