
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
This learning module is for advance programming for second year college students.
Typology: Thesis
1 / 1
This page cannot be seen from the preview
Don't miss anything!
Widget (Grouping) Tk.Frame, ttk.Frame Ttk.LabelFrame Tk.PanedWindow Ttk.Notebook
Purpose Displays set of widgets as one unit Frame but with border and title Group widgets in re-sizable panes Tabbed set of frames, only one visible at a time
treeview = ttk.Treeview ( root ) treeview.pack ( ) treeview.insert ( â â, âitem1â, text = âFirst itemâ) treeview.insert ( â â, âitem2â, text = âSecond itemâ) treeview.cofig (height = 5, column = (âVersionâ)) treeview.column (âVersionâ, width = 50, anchor = CENTER)
root.option_add (â*tearoffâ, False) menubar = Menu (root) root.config (menu = menubar) file = Menu (menubar) edit= Menu (menubar) help_ = Menu (menubar) menubar.add_cascade (menu = file, label = âFileâ) menubar.add_cascade (menu = edit, label = âEditâ) menubar.add_cascade (menu = help_, label = âHelpâ) file.add_command (label = âNewâ, command = lambda: print(âNew Fileâ) file.add_separator () file.entryconfig ( âNewâ, accelerator = âCtrl + Nâ)
from tkinter import filedialog filename = filedialog.askopenfile ( )
from tkinter import colorchooser colorchooser.askcolor ( initialcolor = â#FFFFFFâ )
from tkinter import messagebox messagebox.showinfo( title = âExampleâ, message = âsome textâ ) Widget (information) Purpose Tk.Label, ttk.Label Display static text or image Tk.Message Display static multi line text Ttk.Separator Display a horizontal or vertical separator bar Ttk.Progressbar Show status of running operation Ttk.Treeview Display hierarchical collection of items
Widget (Interactive) Purpose Ttk.Button, tk.Button Execute a command, function or task Tk.Menu Implements Top-level, pull-down and popup menus Ttk.Menubutton Display popup or pull-down menu when activated Tk.OptionMenu Creates a popup menu, and a button to display Tk.Entry, ttk.Entry Text entry (one line only) Tk.Text Text entry (multiple lines) Tk.Checkbutton, ttk.Checkbutton On-Off, True-False selection Tk.Radiobutton, ttk.Radiobutton One or Multiple selections Tk.Listbox Selection from a list of alternatives Ttk.Combobox Combined text field with a pop-down list Tk.Scale, ttk.Scale Moving slider for selecting numerical values Note: Widgets with tk are generic whereas ttk are styled.