Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
112 user(s) are online (85 user(s) are browsing Forums)

Members: 1
Guests: 111

flash, more...

Headlines

 
  Register To Post  

Lame intuition/reaction based questions
Home away from home
Home away from home


See User information
@All

Can anybody explain plz, why when i do this:

//
    
struct IBox box;
    
GetWindowAttrwWA_WindowBox, &boxsizeofbox ) );            
    
DebugPrintF("Before : Left = %d  Top = %d  Width = %d Height = %d\n"box.Leftbox.Topbox.Widthbox.Height);    
    
    
SetWindowAttrwWA_Height, (APTR)(LONG)100sizeof(LONG));

    
GetWindowAttrwWA_WindowBox, &boxsizeofbox ) );
    
DebugPrintF("After : Left = %d  Top = %d  Width = %d Height = %d\n"box.Leftbox.Topbox.Widthbox.Height);


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).

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Lame intuition/reaction based questions
Just can't stay away
Just can't stay away


See User information
@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.

Go to top
Re: Lame intuition/reaction based questions
Home away from home
Home away from home


See User information
@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
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Lame intuition/reaction based questions
Not too shy to talk
Not too shy to talk


See User information
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.

Go to top
Re: Lame intuition/reaction based questions
Home away from home
Home away from home


See User information
@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 ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Lame intuition/reaction based questions
Just can't stay away
Just can't stay away


See User information
@kas1e

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

struct wbdata_t {
APTR window;
struct Gadgets *gads;
...
STRPTR win_path;
};

Go to top
Re: Lame intuition/reaction based questions
Not too shy to talk
Not too shy to talk


See User information
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...

Go to top
Re: Lame intuition/reaction based questions
Home away from home
Home away from home


See User information
@Javier
Quote:

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..

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Lame intuition/reaction based questions
Just can't stay away
Just can't stay away


See User information
@kas1e

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?

I "added" CloseWindow() on my buggy version.

Go to top
Re: Lame intuition/reaction based questions
Home away from home
Home away from home


See User information
@Javier
Quote:

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

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Lame intuition/reaction based questions
Just popping in
Just popping in


See User information
@kas1e:

have a look at workbench.library/WhichWorkbenchObject
with the tag WBOBJA_DrawerPath

Go to top
Re: Lame intuition/reaction based questions
Not too shy to talk
Not too shy to talk


See User information
@kas1eQuote:
kas1e wrote:
As one more idea .. but not very "system" ones imho :) Anwyay, thanks for idea..

I agree. I just couldn't find another way to access that information.

Quote:
But why you need to check dimensions ? Just for sake of double-checking ?

Yeah, it's a sanity check, just in case the Intuition current window and ARexx current window somehow aren't the same window.

Go to top
Re: Lame intuition/reaction based questions
Just can't stay away
Just can't stay away


See User information
@Daedalus

<offtopic>
BTW when do you plan another codign stream?
</offtopic>

Go to top
Re: Lame intuition/reaction based questions
Home away from home
Home away from home


See User information
@Ami603
Quote:

have a look at workbench.library/WhichWorkbenchObject
with the tag WBOBJA_DrawerPath


Wow, thanks! Seems to be what i need !:

screen IIntuition->LockPubScreen(NULL);
....
        
IWorkbench->WhichWorkbenchObject(NULL,screen->MouseX,screen->MouseY,
                                    
WBOBJA_FullPath,&path,
                                    
WBOBJA_FullPathSize,1024,
                                    
WBOBJA_DrawerPath,&dpath,
                                    
WBOBJA_DrawerPathSize,1024,
                                    
TAG_DONE);
        
        
        
IExec->DebugPrintF("path = %s\n",path);
        
IExec->DebugPrintF("dpath = %s\n",dpath);

....



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
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Lame intuition/reaction based questions
Not too shy to talk
Not too shy to talk


See User information
@Ami603Quote:
Ami603 wrote:@kas1e:

have a look at workbench.library/WhichWorkbenchObject
with the tag WBOBJA_DrawerPath

Oh, cool - that's a new addition for OS4. It would be most helpful in OS3.

@jabiruloQuote:
jabirulo wrote:@Daedalus

<offtopic>
BTW when do you plan another codign stream?
</offtopic>

:) Whenever I have some time. I'm pretty busy at the moment but I'll get back to it soon...

Go to top
Re: Lame intuition/reaction based questions
Just can't stay away
Just can't stay away


See User information
@kas1e
Quote:
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.

Go to top
Re: Lame intuition/reaction based questions
Home away from home
Home away from home


See User information
@All
Is there a way to check if a clicked icon is one sitting on the desktop (i.e., main root icon), or not ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Lame intuition/reaction based questions
Just can't stay away
Just can't stay away


See User information
@kas1e

Doesn't WBOBJA_FullPath tag get what you want?

Or maybe WBOBJA_Type.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project