08-03-2010 08:19 AM
Using Labwindows/CVI 8.1.0 on Windows XP.
I have a "virtual o'scope" graph display on a panel, and a parameters setup panel that, among other things, allows me to set the background color for the graph.
After returning from the setup panel I call :
// Set the scope BG color.
SetCtrlAttribute(iHandle_VOscope,VSCOPE_SCREEN,ATTR_PLOT_BGCOLOR,(int)G_VOscopeSetup.item[OSCOPEBGCOLOR].nvalue);
and then
status = DisplayPanel (iHandle_VOscopeSetup);
to refresh the screen.
The problem is that the background color on the graph doesn't change unless I close the window and reopen it. I've also called
RefreshGraph (iHandle_VOscope, VSCOPE_SCREEN);
after setting the background color, and that doesn't work either.
Any suggestions would be appreciated.
08-03-2010 08:49 AM
Hi,
Did you try ProcessDrawEvents?
RefreshGraph isn't expected to work here because it only redraws plots.
08-03-2010 09:44 AM
Nope, ProcessDrawEvents doesn't do it either. The funny thing is that if I put a breakpoint in after the set-parameters panel exits (I hit the "Done" button, and it calls the SetCtrlAttribute function) it redraws the background.
08-03-2010 02:50 PM
(banging head softly against wall, so as to not damage the plaster)
When I closed the setup panel, I was saving the new settings from the panel to the common structure (where the main panel could find them) _after_ I refreshed the main panel. Amazing what happens when you do things in the right order.