How do you find the postion of the window? From my main window, when i am about to open a new one, i need to find the postion of it, so i can place the new one in front of it. But how? And is it possible to lock the main window, so it can't be moved until the new one has been closed?
How do you find the postion of the window? From my main window, when i am about to open a new one, i need to find the postion of it, so i can place the new one in front of it. But how?
Also for Reaction windows checkout the WINDOW_Position, WPOS_CENTERWINDOW flag
Fot a plain intuition window use
GetWindowAttrs() instead, same tags
Quote:
And is it possible to lock the main window, so it can't be moved until the new one has been closed?
Not so sure about that one, many of the attribues that affect window arranging can only be set an window open / NewWindow time, so this may not be possible. Depending on your context your might set your new window to a Stay Top window. But only do that if you have agood reason.
Antique wrote: And is it possible to lock the main window, so it can't be moved until the new one has been closed?
You may be able to prove me wrong, but I doubt it: There is no reason whatsoever that I can think of that will justify forcing such a position-lock on your user. All windows should always be free to be placed like the user wants, not like the programmer thinks the user wants.
It can be quite reasonable to deactivate your main window (so it won't process any input) while your new window is active, and it may even sometimes be a good idea to make your new window a stay-on-top window to make sure it is always visible as long as it is active. But there is no reason why the user shouldn't be able to move either window to one or the other side as she wishes, in order to be able to see content in the main window e.g. for reference while inputting in the new window, or just because she wants to (even if you, the programmer, has not foreseen the reason why she wants to).
So basically: forget it. There are good reasons why it is not an option in AmigaOS.
I completely agree with everything you say. Forcing UI control like that is a quick way to get your program uninstalled. The position of windows should be under the control of the user. It is their Workbench after all, not the developer's ... however there is a way to prevent moving the window. Just don't provide a drag bar, though that would be in place for the window's entire duration.
I ended up using WINDOW_Position, WPOS_CENTERMOUSE. I'm letting the user click on a picutre, and then i size it up. Butbefore the user can then do anything more on main window. He has to close the newly opened window. This has been the reason for my little porblem. And since he has to click on the picture, i can just open it below the pointer. I will let the user be able to move the main window. But it has been disabled until picture has been closed again. Hope this gives any meaning at all
You could close the picture window when the user moves the mouse out of the window boundaries. Then he does not need to click on the picture to close it.
Instead of locking the main window (like windoze does which drives me crazy on a daily basis! ) you can make the popup window follow the main window by listening to some window move signals on the main window and then perform a MoveWindow(?) on the popup to make it follow.
Software developer for Amiga OS3 and OS4. Develops for OnyxSoft and the Amiga using E and C and occasionally C++
But still, I don't see any reason why the two windows cannot be moved independently.
Antique did already earlier agree to this and was planning to allow the main window to be moved, but to let it be disabled (and ghosted, I hope?) until the child window is closed. This, I believe, is the correct and user-friendly decision.
What i now have done is that the newly window can not be moved. The main window can be moved but is disabled until the new window is closed. Seems like the best way i think.