tkinter course
Desktop apps with Python: every tkinter and ttk component, from labels to data tables, with the real window.
In DMarlon Studio, tkinter is the Desktop (Python) target: drag components from the palette onto the form, set their properties in the inspector and the studio writes this same tkinter code.
Basic tkinter course
20 lessonsFrom scratch: everything you need to write your first programs.
- 1Your first windowCreate a desktop window with Python and tkinter: Tk(), title, size and mainloop(). The same window DMarlon Studio designs in Desktop (Python).Lesson 1
- 2Labels: text and coloursShow text in a tkinter window with Label: font, colours, alignment with anchor and line breaks with wraplength.Lesson 2
- 3Buttons and their actionA tkinter button with command: every click calls a function that updates a counter. Plus disabled buttons with state.Lesson 3
- 4Text fields with StringVarThe tkinter text field (Entry) bound to a StringVar: an initial value, reading it with get() and a label that changes as you type.Lesson 4
- 5Password fieldsHide what is typed in a tkinter Entry with show="•" and add a button that shows or hides the password.Lesson 5
- 6Multi-line textThe tkinter Text widget: several lines, word wrapping, tags for bold and colours, and positions written as line.column.Lesson 6
- 7Checkboxestkinter checkboxes (Checkbutton), each with its own BooleanVar: some checked at the start and a summary that changes on every click.Lesson 7
- 8Radio buttonsA group of tkinter Radiobuttons: one StringVar for the whole group, one option chosen at the start and a price that follows it.Lesson 8
- 9Lists of itemsThe tkinter Listbox: adding items, leaving one or more selected with selection_set, selectmode, and reading the selection with curselection().Lesson 9
- 10Drop-down listsThe ttk Combobox: a list of values, the initial value with current() or set(), read-only mode and the <<ComboboxSelected>> event.Lesson 10
- 11SlidersPick numbers by dragging with tkinter's Scale: horizontal and vertical, with a title, range, step and visible value, plus ttk.Scale.Lesson 11
- 12Spinbox: values with arrowstkinter's ttk.Spinbox: numbers with from_, to and increment, a fixed list of values with wrap, and decimals with format.Lesson 12
- 13Frames for groupingGroup a tkinter form with Frame and LabelFrame: titled sections, rows of label and field, and a bar of buttons.Lesson 13
- 14Layout with packtkinter's pack manager: side, fill and expand to build a header, a toolbar, side panels and a central area that grows.Lesson 14
- 15Layout with gridtkinter's grid manager: rows, columns, sticky, columnspan and weights for a form that adapts to the size of the window.Lesson 15
- 16Layout with placetkinter's place manager: absolute positions in pixels, positions relative to the window's size, and anchor. It is the one DMarlon Studio uses.Lesson 16
- 17ScrollbarsA ttk.Scrollbar connected to a tkinter Listbox and Text: yview, xview and yscrollcommand, both vertical and horizontal.Lesson 17
- 18Separator, Message and SizegripThree small tkinter widgets: ttk.Separator to divide, tk.Message for text that wraps by itself and ttk.Sizegrip to resize.Lesson 18
- 19ttk styles and themesChange how ttk widgets look with ttk.Style: themes, configure() for a style, custom styles such as Accent.TButton, and map().Lesson 19
- 20Project: a registration formA registration form with tkinter and grid: entries, a password, a drop-down list, options, a checkbox and a button that checks the data.Lesson 20
Advanced tkinter course
20 lessonsFor those who know the basics: the techniques used in real projects.
- 1Canvas: shapes and textDraw rectangles, ovals, polygons, lines, arcs and text on a tkinter Canvas, and understand its coordinates, item ids and tags.Lesson 1
- 2A bar chartDraw a bar chart on a tkinter Canvas from a dictionary of data: scale, grid lines, axes and labels.Lesson 2
- 3Images made in codeCreate tkinter images without files: tk.PhotoImage, put() to paint pixels and zoom() to enlarge them, shown in a label and a button.Lesson 3
- 4Treeview as a tableShow data in rows and columns with tkinter's ttk.Treeview: columns, headings, alignment, coloured rows and a row selected from code.Lesson 4
- 5Treeview as a treeBuild a folder tree with tkinter's ttk.Treeview: parent and child nodes, open or closed branches and a recursive function.Lesson 5
- 6Progress barsShow how a task is going with tkinter's ttk.Progressbar: determinate mode with value and maximum, indeterminate mode and vertical bars.Lesson 6
- 7Tabs with NotebookOrganise a tkinter window into tabs with ttk.Notebook: pages, a disabled tab, the starting tab and the tab-changed event.Lesson 7
- 8Resizable panesSplit a tkinter window into panes the user resizes by dragging, with ttk.Panedwindow: horizontal, vertical, nested and weighted.Lesson 8
- 9The menu barBuild a tkinter window's menu bar with tk.Menu: cascading menus, separators, shortcuts, check items and radio items.Lesson 9
- 10Context menu and menu buttonsOpen a menu on right-click in tkinter (tk_popup) and use ttk.Menubutton and tk.OptionMenu to pick options inside the window.Lesson 10
- 11The status barAdd a status bar to a tkinter window: a frame at the bottom with sunken labels that are updated from code.Lesson 11
- 12A toolbar with iconsBuild a ribbon-like row of buttons in tkinter: groups with LabelFrame and buttons with icons drawn in code with PhotoImage.Lesson 12
- 13Secondary windowsOpen more windows in a tkinter application with Toplevel: title, size and position, modal windows and destroy() to close them.Lesson 13
- 14Message and input dialogsUse tkinter's messagebox and simpledialog: notices, questions and input prompts, and what each function returns when closed.Lesson 14
- 15File and colour dialogsPick files, folders and colours with tkinter's filedialog and colorchooser, and learn what each dialog returns on OK or Cancel.Lesson 15
- 16Timers with after()Schedule work over time with tkinter's after(): a countdown that repeats every second, pauses with after_cancel and never blocks the window.Lesson 16
- 17Events and bindRespond to the mouse and keyboard in tkinter with bind: clicks, double clicks, motion, the mouse leaving and keys, with each event's data.Lesson 17
- 18Control variables and traceUse tkinter's StringVar, IntVar and BooleanVar with trace_add to recalculate a live total every time a field changes.Lesson 18
- 19Validating inputValidate tkinter fields with validate and validatecommand: reject invalid keys and flag errors with the invalid state and a red style.Lesson 19
- 20Project: a product listFinal tkinter project: a small CRUD app for products with a Treeview, a form, a menu bar and a status bar.Lesson 20