FrameNotebook¶
- class decida.FrameNotebook.FrameNotebook(parent=None, **kwargs)¶
Bases:
ItclObjectxsynopsis:
Tab-notebook widget.
FrameNotebook is a widget for packing other frames containing content in a tabbed-notebook. Tabs and associated frames can be added after the notebook has been created.
FrameNotebook is used by DataViewm to organize the plots in a tabbed-notebook format. It is also used to display TextWindow and DataViewm help information.
constructor arguments:
parent (tk handle, default=None)
handle of frame or other widget to pack frame notebook in. if this is not specified, top-level is created.
header (bool, default=True)
if True, add quit/status line
**kwargs (dict)
configuration-options
configuration options:
verbose (bool, default=False)
enable/disable verbose mode
tab_location (str, default=”top”)
notebook tab location = top or right
wait (bool, default=False)
wait in main-loop until window is destroyed
wait_to_display (bool, default=False)
display only after wait (for help windows)
resize (bool, default=False)
resize tab to child in tab
example: (from test_FrameNotebook_1)
from decida.FrameNotebook import FrameNotebook from decida.TextWindow import TextWindow from decida.XYplotm import XYplotm from decida.Data import Data fn = FrameNotebook(tab_location="top", destroy=False) tw = TextWindow(fn.new_page("text")) d = Data() d.read("LTspice_ac_ascii.raw") XYplotm(fn.new_page("plot"), command=[d, "frequency DB(V(vout1)) PH(V(vout1))"], title="AC analysis", xaxis="log", ymin=-60.0, ymax=0.0, wait=False) fn.status("waiting to add new page") fn.wait("continue") fn.status("")
public methods:
public methods from ItclObjectx
- current_tab()¶
return current unique tabid.
results:
The current (visible) page tabid is returned.
- del_page()¶
delete current page.
results:
The current page (tab/frame pair) are removed from the notebook.
- lift_tab(tabid)¶
display tab/page in the notebook.
arguments:
tabid (str)
A unique tabid associated with a particular page.
results:
The page associated with the tabid is raised (made visible).
- new_page(name, lift=True)¶
return a new page frame, make new notebook tab.
arguments:
lift (bool, default=True)
If lift is True, raise tab/frame after it is created.
results:
A new page (tab/frame pair) is created and the handle to the associated tk Frame is returned. This is used as a parent to pack new content in.
- relabel_current_tab(label)¶
set current tab label.
arguments:
label (str)
text to re-label the current tab
results:
The current tab is relabled with label.
- reqheight()¶
return required height of the top widget
- reqwidth()¶
return required width of the top widget
- status(message)¶
display status message.
arguments:
message (str)
status message to display
results:
message is displayed in the status bar of the FrameNotebook
- tabs()¶
return list of tabids.
results:
list of existing tabids is returned. A tabid can be used to refer to a particular tab/Frame pair.
- wait(text=None)¶
wait in main-loop until main window is destroyed.
arguments:
text (str, default=None)
If text is specified, a button is displayed with the text in the button. Clicking the button releases the application from the main event-loop.
results:
If no text is displayed, then the application waits for the FrameNotebook instance to somehow be destroyed. If text was specified, then the application waits until the button is clicked.