SetWindowModified

  1. 2 weeks ago

    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?

    @Michael G 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?

    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.

  2. Tanner L

    is not verified Oct 6 Pre-Release Testers Toronto, Canada

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

  3. last week

    Sam R

    Oct 7 Pre-Release Testers, Xojo Pro Answer Hengchun, Pingtung, Taiwan

    @Michael G 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?

    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.

  4. 7 days ago

    Even better! Thanks guys.

or Sign Up to reply!