While i do change the size of window actually, the latest GetWindowAttr() do not reflect the changes i do, and printf for me the same values (while, i can see the size of window changes).
@kas1e A lot of intuition, not only BOOPSI gadgets/images/etc., is done asynchronously, not directly executing the code in the task calling some intuition functions but sending messages to it's input.device task which (later) does the actual work. Simple functions like IIntuition->GetWindowAttr() may be executed immediately in the task using them, but functions doing more complex things like changing the size of a window with IIntuition->SetWindowAttr() may be forwarded to the input.device task.
@joerg Added simple IDOS->Delay(1); did the trick indeed ! Isn't there some "safe" and fast way to do that (as Delays are suck hard of course).
I mean, not adding some "microseonds" of wait (which probably will be different on different hardware), but some kind of safe API maybe calling after SetAttr ?
Another question (if you doesn't mind): Is there a safe way how to extend the wb window in terms of gadgets : i.e. i want to shift down to 24 pixels a top gadget "name","type" and "data" of the already opened window, insert in this new place my new gadget, and refresh the window, so it will looks as i need (preferable for users to not notice how those changes to the window applied).
Currently, the new gadget i add by patching just overwrite the window's content on top. I am thinking that probabaly i need to read whole window gadgets by getattr(), relayout them, and upload them back via setattr() together with my new ones.
Edited by kas1e on 2023/11/21 6:50:44 Edited by kas1e on 2023/11/21 6:52:30
Ordinarily, waiting for IDCMP_NEWSIZE would be the "safe" way to know the resize has been completed and the new size values present in the window struct. I'm not sure if that's easy to detect though when you don't own the window yourself.
@All Is there any correct way to know the full path of the opened workbench window ? So far all i find is *Title string in the window's structure , but i am sure there should be something better to get this information from a workbench window ?
Don't think there is. Maybe insde wb_lib or whoever do such task to open wb drawers/windows uses a "own" struct with some data and one is STRPTR for fullpath. something like
There's no way that I know of using the standard API. I used the ARexx interface to get the name of the currently active window, and then checked to make sure the dimensions matched the window struct of the current window from Intuition so I could be reasonably sure it was the same window. This isn't bullet-proof of course...
Maybe insde wb_lib or whoever do such task to open wb drawers/windows uses a "own" struct with some data and one is STRPTR for fullpath.
Question is where is it :)
Quote:
I used the ARexx interface to get the name of the currently active window,
As one more idea .. but not very "system" ones imho :) Anwyay, thanks for idea.. But why you need to check dimensions ? Just for sake of double-checking ?
@All When we click on icon, it involves surely some more functions and not only "openwindowtaglist()", but maybe something else which did containt "full path" in structs ? It should be somewhere all in all..
Does DrawerGenie get such path too? Then you can look in its sources how.
You posted that DG does "SetMethod()" in these functions: /* SetMethod(): OpenWindowTagList() CloseWindow() SetWindowTitles() AddAppWindowA() AddAppWindow() AddAppWindowDropZoneA() RemoveAppWindow() RemoveAppWindowDropZone() LockLayerInfo() */ Maybe one of Add#? or Set#? is getting such stringpath, can you check what they do?
Does DrawerGenie get such path too? Then you can look in its sources how.
DrawerGeniue written by Daedalus on BlitzBasic, he already answer in the previous post how he do it :) (arexx interface)
Quote:
You posted that DG does "SetMethod()" in these functions:
It wasn't about DG, but about Dopus5 :) Its list of patched functions for Dopus5 when it's in workbench replacement mode. Yeah, will check, maybe it will bring some idea as well
Through found some moment : when one window opens on top of the previous ones, and the mouse cursors are over both of them, then i have empty string returned. While i were expected to get it from the active window.. But maybe there another flag for ?
Edited by kas1e on 2023/11/24 3:13:40 Edited by kas1e on 2023/11/24 3:19:19
Through found some moment : when one window opens on top of the previous ones, and the mouse cursors are over both of them, then i have empty string returned. While i were expected to get it from the active window.. But maybe there another flag for ?
If you pass the pointer of the active window instead of NULL, and change the mouse x/y to be relative to the top/left of that window instead of the screen, you should get what you want.