Drawing to Igor window from XOP

I have been looking for a method to draw directly to an Igor Window. The Igor window of interest is easily obtained, as is a device context for drawing. The code works and the drawing occurs. I can see it flickering. The window is then overwritten when Igor's OnPaint handler runs, which is after my Igor user function completes (I assume). This all seems normal and expected.

However, I could not find either XOP draw text/lines/etc. callbacks that would allow me to tell Igor to add something to the window or a hook to the OnPaint (or equivalent) message.

My current purpose is for debugging my XOP. However, this would be of use in general as well.

Am I missing something, or is this not possible?

Thanks.

Sample code in a standard XOP function:

<br />
// The window's name is provided through a function parameter and stored in graphName<br />
// Get the correct child window of Igor. In this case, it is an Igor graph window <br />
    CWindow mdiwin = IgorClientHWND();<br />
    CWindow graphwin = ::FindWindowEx(mdiwin, NULL, _T("IgorGraphChild"), graphName));<br />
<br />
// Ensure that we have a window to work with<br />
    if (graphwin.IsWindow())<br />
    {<br />
    // Get a device context, font, and other drawing objects to work with<br />
        CDC dc = graphwin.GetDC();<br />
    <br />
        CRect r (0, 0, 100, 100);<br />
<br />
    // Draw to the device context<br />
        dc.DrawFocusRect(r);<br />
    }<br />


Using Igor 6.3.4.1. Windows 7. Developer Studio 10. WTL/ATL for window function (equivalent to MFC but uses CWindow instead off CWnd)
What you are doing is not supported.

You can create your own window. This is described in the XOP manual.

However I think there are easier ways to debug such as using XOPNotice to write to Igor's history area or XOPCommand to create and write to an Igor window using Igor commands.
hrodstein wrote:
What you are doing is not supported.

You can create your own window. This is described in the XOP manual.

However I think there are easier ways to debug such as using XOPNotice to write to Igor's history area or XOPCommand to create and write to an Igor window using Igor commands.


I figured that it was not supported as written above. The XOPCommand is what I was looking for. I am familiar with the XOPNotice for sending text to the history window. The debugging has to do with position in the window, which is best seen by actually drawing a shape as needed.

Something like:
<br />
    sprintf(cmd, "DrawRect /W=%s 0.1, 0.1, 0.2, 0.2", graphName.c_str());<br />
    XOPCommand(cmd);<br />


gives me what i need.

thanks.