FrameNotebook

_images/FrameNotebook.jpg
class decida.FrameNotebook.FrameNotebook(parent=None, **kwargs)

Bases: decida.ItclObjectx.ItclObjectx, Tkinter.Frame

synopsis:

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 DataViewx to organize the plots in a tabbed-notebook format. It is also used to display TextWindow and DataViewx help information.

constructor arguments:

parent (Tkinter 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)

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
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 Tkinter 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.
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 TextWindow instance to somehow be destroyed. If text was specified, then the application waits until the button is clicked.