ttk.LabelFrame
ttk.LabelFrame erzeugen
lf = ttk.LabelFrame(parent, Optionen)
| Optionsname | Beschreibung |
|---|---|
| height, width | Höhe, Breite in Pixeln |
| labelanchor | Position des Labels, siehe Option anchor |
| labelwidget | Anderes Widget als Label, überschreibt auch Option text. Dieses Widget
muss ein Child des LabelFrames oder des Parents von LabelFrame sein. |
| text | Text des Labels |
| underline | Index des zu unterstreichenden Buchstabens, 0-basiert |
ttk.LabelFrame kennt die Standardoptionen: class_, cursor, padding, style und takefocus
Das folgende Programm stellt ein LabelFrame vor:
import tkinter as tk
from tkinter import ttk
class A(tk.Tk):
def __init__(self):
super().__init__()
self.geometry("300x300")
self._createWidgets()
def _createWidgets(self):
lf = ttk.LabelFrame(self, text='Ein LabelFrame')
lf.pack(expand=tk.YES, fill=tk.BOTH, padx=2, pady=2)
if __name__ == '__main__':
window = A()
window.mainloop()
LabelFrame-Methoden
- Konfigurationsmethoden:
cget(…)undconfigure(…) - Sonstige Methoden:
identify(…),instate(…)undstate(…)