X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 10 Sep 2018 10:16 AM by  Daniel Weimer
Getting location of a graphics WINDOW() after creation
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

Daniel Weimer



New Member


Posts:2
New Member


--
10 Sep 2018 10:16 AM
    When a WINDOW() graphic is created, the position on the screen can be set with the LOCATION keyword, that can be used only at the initial creation.
    When handling mouse clicks through a subclass of 'GraphicsEventAdapter', I would like to find out where the window is currently located (or the location of the click in the coordinate system of the entire screen), particularly if the window has been dragged around by the user.
    The 'ConvertCoord' doesn't seem to work for this, since with the /TO_DEVICE keyword set it only seems to return pixel coordinates within the WINDOW() itself, rather than the entire screen.

    If WIDGET_WINDOW is used within a WIDGET_BASE, then WIDGET_INFO(base,/GEOMETRY) does work to get the correct offset, even if the window was moved around since creation. I'm looking for a way to get the position with a regular WINDOW() object.

    (With the old-style, direct graphics the conversion with /TO_DEVICE would return coordinates on the screen.)

    Ben Castellani



    Basic Member


    Posts:130
    Basic Member


    --
    12 Sep 2018 11:52 AM
    Unfortunately this is currently not possible in IDL. I won't be able to provide a work-around either as this functionality lives in Java (for normal WINDOW calls from the Workbench) or in C libraries if you use the /WIDGETS keyword.

    There is an existing feature request to add LOCATION as a property to the WINDOW object, thus allowing the user to retrieve or update the window's location post-creation. The reference ID for this feature request in our database is IDL-69825.
    You are not authorized to post a reply.