Bases: decida.ItclObjectx.ItclObjectx, Tkinter.Frame
tab-notebook widget.
synopsis:
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 DataViewx to organize the plots in a tabbed-notebook format. It is also used to display TextWindow and DataViewx help information.
handle of frame or other widget to pack frame notebook in. if this is not specified, top-level is created.
if true, add quit/status line
configuration-options
configuration options:
- verbose (bool) (default=False)
enable/disable verbose mode
- tab_location (string) (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)
example: (from test_FrameNotebook_1)
from decida.FrameNotebook import FrameNotebook
from decida.TextWindow import TextWindow
from decida.XYplotx import XYplotx
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")
XYplotx(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
return current unique tabid.
results:
- The current (visible) page tabid is returned.
delete current page.
results:
- The current page (tab/frame pair) are removed from the notebook.
display tab/page in the notebook.
arguments:
- tabid (string)
A unique tabid associated with a particular page.
results:
- The page associated with the tabid is raised (made visible).
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 Tkinter Frame is returned. This is used as a parent to pack new content in.
set current tab label.
arguments:
- label
text to re-label the current tab
results:
- The current tab is relabled with label.
display status message.
arguments:
- message (string)
status message to display
results:
- message is displayed in the status bar of the FrameNotebook
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 in main-loop until main window is destroyed.
arguments:
- text (string, 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 TextWindow instance to somehow be destroyed. If text was specified, then the application waits until the button is clicked.