Open Window Requests for child windows
Matthew Phillips (473) 721 posts |
I am writing an application which can act as a plugin to other applications. The client application can send a message to my application and my application will then open a child window within the client’s window, and handle all the user interactions. This is working well. Unfortunately I have run into trouble. The child window includes a writable icon, and when the user types I want to open a separate window positioned just below the icon, showing a number of options which the user can pick from to complete the text in the writable icon. This window cannot be a child of the client’s parent window, because it often needs to be wider and longer than the parent window. Therefore I am opening it at the top of the window stack. If the user moves the client’s parent window, or indeed closes it, the Wimp moves my plugin’s child window automatically, and issues redraw requests when necessary. But no Open Window requests are issued for the child window. This makes it hard to do the right thing with my pop-up list of options. I would like it to move to maintain its position relative to the writable icon. I’ve tried looking through the documentation to see if there are any flags that affect whether child windows receive events, but I cannot find any. The best I can do, I think, is to ask for Null polls and keep tabs on where the client’s parent window has moved to. Does anyone have any better ideas? |
Steve Fryatt (216) 2105 posts |
The other option, which might be a lot of hassle as it would require code living outside of the application space, would be to apply a post-poll filter to the client and look for Open Window Request events for the parent window.
I don’t recall finding anything when I wrote https://www.stevefryatt.org.uk/risc-os/panes/responsive-nesting, but there I did at least own the parent window and so could listen out for events on it. |
nemo (145) 2546 posts |
Filter the parent task; spot OpenWindow for the parent window; set your pollword. |
Jon Abbott (1421) 2651 posts |
As already mentioned RMA hosted code or a Module with a PreFilter or PostFilter are what you’re after. |
Matthew Phillips (473) 721 posts |
Thanks for confirmation that I am not missing anything. For simplicity I’ve enabled null polls at 1ms intervals while the extra window is open, and I am able to keep the windows tied together like that. |
Matthew Phillips (473) 721 posts |
And I meant to add that Steve’s tutorial is excellent: by far the best explanation of panes and nested windows. |