Page 1 of 1

DestroyTrackWindow() in UserGuide code. Pointer type mismatch?

Posted: Fri Feb 13, 2026 2:25 am
by Webarion
In the code:

Code: Select all

  Procedure.i DestroyTrackWindow(Window.i)
    ; Remove Window from the ActiveWindows map, release the allocated memory,
    ; close the window and set the quit flag, if appropriate.
    Shared EventQuit, ActiveWindows()
    Protected *ThisData.DATEWINDOW <---
    ...
Perhaps this should be: .TRACKWINDOW

Re: DestroyTrackWindow() in UserGuide code. Pointer type mismatch?

Posted: Fri Feb 13, 2026 9:45 am
by mk-soft
You're wrong with your question here.

Source of the code not specified and (after searching for it) the code not copied correctly and completely with structures.

No Bug

Re: DestroyTrackWindow() in UserGuide code. Pointer type mismatch?

Posted: Fri Feb 13, 2026 2:22 pm
by Webarion
mk-soft wrote: Fri Feb 13, 2026 9:45 am You're wrong with your question here.

Source of the code not specified and (after searching for it) the code not copied correctly and completely with structures.

No Bug
Yes, this is a question about the code in the documentation:
https://www.purebasic.com/documentation ... _any2.html
I understand that TRACKWINDOW and DATEWINDOW are the same size and this will not cause an error, however I believe it is logically incorrect when creating a TRACKWINDOW in CreateTrackWindow() to free the DATEWINDOW in DestroyTrackWindow(Window.i). This creates confusion, which is why I didn't realize it at first when translating and analyzing it. The question is closed.

Re: DestroyTrackWindow() in UserGuide code. Pointer type mismatch?

Posted: Fri Feb 13, 2026 2:27 pm
by spikey
Webarion wrote: Fri Feb 13, 2026 2:25 am Perhaps this should be: .TRACKWINDOW
Yes, you are correct, it should be TRACKWINDOW. It's a "copy/paste/fail to update" error on my part.

It does prove that it's extremely difficult to proofread your own work fully!

Proposed fix in PR#349.