Size Issues when hosting a graph/Image in a panel
coltblaze
I had made a panel which controls an image selection menu to plot the image. This image is being hosted in the subwindow of the control panel the issue is that despite given a large space to host the image in the panel; the image is the in the default size same as what is usually plotted by IGOR when plotted from a data browser by right click -> New Image option on wave in the data browser.
The Display command has the /W flag to control window size- it works with both main windows and subwindows. For subwindows, you also have the /FG flag to attach edges of the subwindow to subwindow guides. Doing that makes it possible to create a subwindow that resizes nicely when the host window is resized.
Give this a thorough read: DisplayHelpTopic "Embedding and Subwindows"
September 6, 2018 at 09:14 am - Permalink
Well I had been able to pin down what was wrong.
What I did was
NewPanel /HOST=$ba.win /EXT=0/W=(10,30,340,420)
ModifyPabel Fixedsize=0
Display /W=(20,30,300,400)/Host=#
NewImage /Host=#/N=Preview $cwd1
but the problem crept in due to the
NewImage/Host=#/N=Preview $cwd1
in order to solve it one need to have
AppendImage $cwd1
September 6, 2018 at 09:52 pm - Permalink
But now my question is if I resize the panel by dragging the corner will my image also adjust to the ratio the window was stretched?
If not then how can we add this feature?
September 6, 2018 at 09:56 pm - Permalink
In reply to But now my question is if I… by coltblaze
I don't uses subwindows much so I don't have a direct answer to your question, however, in his response John stated:
September 7, 2018 at 05:02 am - Permalink
The /FG flag does not serve the purpose in this case.
Display /W=(20,30,300,400)/FG=(FL,FR,FT,FB)/Host=#
When I stretch from a corner to stretch it both ways the stretch is yielded only top to bottom in the image the same happens tfor the single side stretch irrespective of the direction while for sideways it does not yield to any change.
September 10, 2018 at 10:59 pm - Permalink
In reply to The /FG flag does not serve… by coltblaze
Perhaps you could set a window hook function that monitors the aspect ratio of the embedded plot and adjusts its size accordingly?
September 10, 2018 at 11:41 pm - Permalink
Try this command:
Display /W=(20,30,300,400)/FG=(FL,FT,FR,FB)/Host=#
You swapped FT with FR.
September 11, 2018 at 03:34 pm - Permalink
In reply to Try this command: Display … by johnweeks
the error is now rectified thanks John Weeks
September 11, 2018 at 10:55 pm - Permalink