A collection of useful tkinter widgets.
Project description
A collection of useful Tkinter widgets and mega-widgets.
This package contains:
- CollapsiblePane:
A LabelFrame derivitive that can be collapsed by clicking on the label.
- LabelButton:
A Label derivitive that is clickable like a button, with rollovers and focus.
- TabbedNoteBook:
A notebook that provides Safari-style tabs, with optional close-buttons per tab.
- Wizard:
A wizard dialog with Prev/Next/Finish/Cancel buttons, which progresses through multiple panes of widgets.
- ScrolledListbox:
A Listbox widget with scrollbars, similar to the ScrolledText widget.
CollapsiblePane
Example code:
from belfrywidgets.collapsiblepane import CollapsiblePane tk = Tk() cp = CollapsiblePane( tk, text="Click Here to Collapse", visible=True, collapsible=True, ) cp.pack(side=TOP, fill=BOTH, expand=1, padx=5, pady=5) lbl1 = Label(cp.holder, text="This is a label.") lbl2 = Label(cp.holder, text="This is another label.") lbl1.pack(side=TOP) lbl2.pack(side=TOP) tk.mainloop()
TabbedNoteBook
Example code:
from belfrywidgets.tabbednotebook import TabbedNoteBook def _closeit(name): print("Close tab %s" % name) return True # Return True to allow closing tab. tk = Tk() tnb = TabbedNoteBook(tk, width=640, height=480) tnb.pack_propagate(False) # Keep noteboox from shrinking to fit contents. tnb.pack(side=TOP, fill=BOTH, expand=1) pane1 = tnb.add_pane( 'one', 'First Pane', closecommand=lambda: _closeit('one') ) lbl1 = Label(pane1, text="This is a label.") lbl1.pack(side=TOP, fill=BOTH, expand=1) pane2 = tnb.add_pane( 'two', 'Second Pane', closecommand=lambda: _closeit('two') ) lbl2 = Label(pane2, text="This is a second label.") lbl2.pack(side=TOP, fill=BOTH, expand=1) pane3 = tnb.add_pane( 'three', 'Third Pane', closecommand=lambda: _closeit('three') ) lbl3 = Label(pane3, text="This is a third label.") lbl3.pack(side=TOP, fill=BOTH, expand=1) lbl = tnb.pane_label('two') lbl.config(text="Tab 2") tk.mainloop()
Wizard
Example code:
from belfrywidgets.wizard import Wizard root = Tk() wiz = Wizard( width=640, height=480, cancelcommand=lambda: print("Cancel"), finishcommand=lambda: print("Finish"), ) def disable_finish(): wiz.set_finish_enabled(False) def enable_finish(): wiz.set_finish_enabled(True) pane1 = wiz.add_pane('one', 'First', entrycommand=disable_finish) lbl1 = Label(pane1, text="This is the first pane.") lbl1.pack(side=TOP, fill=BOTH, expand=1) pane2 = wiz.add_pane( 'two', 'Second') lbl2 = Label(pane2, text="This is the second pane.") lbl2.pack(side=TOP, fill=BOTH, expand=1) pane3 = wiz.add_pane( 'three', 'Third', entrycommand=enable_finish, prevcommand=disable_finish ) lbl3 = Label(pane3, text="This is the third pane.") lbl3.pack(side=TOP, fill=BOTH, expand=1) # wiz.show_pane('two') # wiz.del_pane('two') # wiz.set_prev_enabled(True) # wiz.set_next_enabled(True) root.wm_withdraw() root.wait_window(wiz)
ScrolledListbox
Example code:
from belfrywidgets.wizard import Wizard root = Tk() lbox = ScrolledListbox( root, horiz_scroll=False, vert_scroll=True, width=30, height=15, ) lbox.pack(side=TOP, fill=BOTH, expand=1) for i in range(1,51): lbox.insert(END, "Item %d" % i) tk.mainloop()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
belfrywidgets-1.0.2.tar.gz
(6.8 kB
view hashes)
Built Distribution
Close
Hashes for belfrywidgets-1.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21d6051a3457be06209eeb81ec4f49782a7e0a66aadbbba87fa73bf2977cd527 |
|
MD5 | 032394868e5c9c2e12efdebaebfb5bca |
|
BLAKE2b-256 | c427466b68ade71bdef36bc446820401ab58cedb83a1f5903f7a8665737bfdf5 |