Hiding Notebooks Embedded in Panels
jjweimer
// function to create panel and embed notebook
Function ShowPanel()
...
NewNotebook/F=1/N=notefield/W=(...)/HOST=#/OPTS=(2)
Notebook LogbookPanel#notefield, statusWidth=0,autosave=0,font=...
...
end
// function to toggle note field on or off (visible + writable or hide + protect)
Function SetNotes(onoff)
variable onof
...
Notebook LogbookPanel#notefield visible=!onoff
return 0
end
Function ShowPanel()
...
NewNotebook/F=1/N=notefield/W=(...)/HOST=#/OPTS=(2)
Notebook LogbookPanel#notefield, statusWidth=0,autosave=0,font=...
...
end
// function to toggle note field on or off (visible + writable or hide + protect)
Function SetNotes(onoff)
variable onof
...
Notebook LogbookPanel#notefield visible=!onoff
return 0
end
The note field disappears as it is supposed to. When it reappears, the previously entered text is white and the embedding frame around the notebook is missing. I have to scroll the notebook, and even then some of the text stays missing.
I've attached a picture of the framed notebook (which is how it starts) and the unframed notebook (which is how it improperly appears after hiding and reshowing).
What am I missing here?
Here is a complete example with a workaround:
DoWindow/F LogbookPanel
if (V_flag == 0)
NewPanel /N=LogbookPanel
NewNotebook/F=1/N=notefield/HOST=#/OPTS=(2)
Notebook LogbookPanel#notefield, statusWidth=0,autosave=1
endif
end
Function ShowNote()
Notebook LogbookPanel#notefield visible=1
// This is a workaround for failure to show text in embedded notebook
Notebook LogbookPanel#notefield backRGB=(65535,65535,65535)
End
Function HideNote()
Notebook LogbookPanel#notefield visible=0
End
July 4, 2011 at 11:20 am - Permalink
Yes ... I should have said I was on a Mac -- I had not yet tested on Windows.
I've "installed" the fix as ...
// This is a workaround for failure to show text in embedded notebook
if (onoff==0)
Notebook LogbookPanel#notefield backRGB=(65535,65535,65535)
endif
#endif
... and that at least brings back the text.
Thanks.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
July 5, 2011 at 05:56 am - Permalink