Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Button(root, text="Button Text", command=button_callback, bg="rgb(255,255,255)",fg="rgb(0,0,0)", font=("Arial",12))
- root: the parent widget where the button will be placed
- text: the text that will be displayed on the button
- command: the function that will be called when the button is clicked
- bg: the background color of the button, specified in RGB values ranging from 0 to 255
- fg: the text color of the button, specified in RGB values ranging from 0 to 255
- font: the font and font size of the text on the button
- label = Label(root, text="Label Text", bg="rgb(255,255,255)", fg="rgb(0,0,0)", font=("Arial",12))
- root: the parent widget where the label will be placed
- text: the text that will be displayed on the label
- bg: the background color of the label, specified in RGB values ranging from 0 to 255
- fg: the text color of the label, specified in RGB values ranging from 0 to 255
- font: the font and font size of the text on the label
- entry = Entry(root, show="*")
- root: the parent widget where the entry field will be placed
- show: the character that will be displayed in place of the user's input (e.g. "*" for password fields)
- canvas = Canvas(root, width=200, height=100, bg="rgb(255,255,255)", highlightthickness=0)
- root: the parent widget where the canvas will be placed
- width: the width of the canvas in pixels
- height: the height of the canvas in pixels
- bg: the background color of the canvas, specified in RGB values ranging from 0 to 255
- highlightthickness: the thickness of the border around the canvas (set to 0 to remove the border)
- listbox = Listbox(root, selectmode=SINGLE)
- root: the parent widget where the listbox will be placed
- selectmode: the selection mode for the listbox, can be SINGLE (only one item can be selected at a time), BROWSE (only one item can be selected and displayed as the "active" item), MULTIPLE (multiple items can be selected at once), or EXTENDED (multiple items can be selected using the Shift and Ctrl/Command keys)
- scrollbar = Scrollbar(root, orient=VERTICAL)
- root: the parent widget where the scrollbar will be placed
- orient: the orientation of the scrollbar, can be VERTICAL or HORIZONTAL
- radiobutton = Radiobutton(root, text="Radio Button Text", variable=radio_var, value=1)
- root: the parent widget where the radiobutton will be placed
- text: the text that will be displayed next to the radiobutton
- variable: a StringVar or IntVar that will hold the value of the selected radiobutton
- value: the value that will be assigned to the variable when this radiobutton is selected
- checkbutton = Checkbutton(root, text="Check Button Text", variable=check_var)
- root: the parent widget where the checkbutton will be placed
- text: the text that will be displayed next to the checkbutton
- variable: a BooleanVar that will hold the state of the checkbutton (True if checked, False if not checked)
- menu = Menu(root)
- root: the parent widget where the menu will be placed
- menu_item = Menu(menu, tearoff=0)
- menu: the parent menu where the menu item will be placed
- tearoff: a parameter that determines whether the menu item can be separated from the menu (set to 0 to disable tearoff)
- submenu = Menu(menu_item, tearoff=0)
- menu_item: the parent menu item where the submenu will be placed
- tearoff: a parameter that determines whether the submenu can be separated from the menu item (set to 0 to disable tearoff)
- menu_item.add_command(label="Menu Item Label", command=menu_callback)
- label: the text that will be displayed on the menu item
- command: the function that will be called when the menu item is clicked
- submenu.add_command(label="Submenu Item Label", command=submenu_callback)
- label: the text that will be displayed on the submenu item
- command: the function that will be called when the submenu item is clicked
- menu.add_cascade(label="Menu Label", menu=menu_item)
- label: the text that will be displayed on the menu
- menu: the menu item or submenu that will be displayed when the menu is clicked
- frame = Frame(root, bg="rgb(255,255,255)")
- root: the parent widget where the frame will be placed
- bg: the background color of the frame, specified in RGB values ranging from 0 to 255
- scale = Scale(root, orient=HORIZONTAL, length=200, from_=0, to=100, tickinterval=25, resolution=1)
- root: the parent widget where the scale will be placed
- orient: the orientation of the scale, can be VERTICAL or HORIZONTAL
- length: the length of the scale in pixels
- from_: the minimum value of the scale
- to: the maximum value of the scale
- tickinterval: the interval between tick marks on the scale
- resolution: the smallest increment that the scale will allow
- spinbox = Spinbox(root, from_=0, to=100)
- root: the parent widget where the spinbox will be placed
- from_: the minimum value that the spinbox will accept
- to: the maximum value that the spinbox will accept
- text = Text(root, width=30, height=10, wrap=WORD)
- root: the parent widget where the text widget will be placed
- width: the width of the text widget in characters
- height: the height of the text widget in lines
- wrap: the wrapping mode for the text widget, can be NONE (no wrapping), CHAR (wrap at character boundaries), or WORD (wrap at word boundaries)
- combobox = ttk.Combobox(root, values=["Option 1", "Option 2", "Option 3"])
- root: the parent widget where the combobox will be placed
- values: a list of values that will be displayed in the combobox
- frame = Frame(root, width=200, height=100, bg="rgb(255,255,255)", highlightthickness=0)
- root: the parent widget where the frame will be placed
- width: the width of the frame in pixels
- height: the height of the frame in pixels
- bg: the background color of the frame, specified in RGB values ranging from 0 to 255
- highlightthickness: the thickness of the border around the frame (set to 0 to remove the border)
- spinner = Spinbox(root, values=(1, 2, 3, 4, 5))
- root: the parent widget where the spinner will be placed
- values: a tuple or list of values that the spinner will allow the user to choose from
- combobox = ttk.Combobox(root, values=("Option 1", "Option 2", "Option 3"))
- root: the parent widget where the combobox will be placed
- values: a tuple or list of values that the combobox will allow the user to choose from
- separator = ttk.Separator(root, orient=HORIZONTAL)
- root: the parent widget where the separator will be placed
- orient: the orientation of the separator, can be VERTICAL or HORIZONTAL
- progressbar = ttk.Progressbar(root, orient=HORIZONTAL, length=200)
- root: the parent widget where the progressbar will be placed
- orient: the orientation of the progressbar, can be VERTICAL or HORIZONTAL
- length: the length of the progressbar in pixels
- slider = Scale(root, from_=0, to=100, orient=HORIZONTAL, resolution=1)
- root: the parent widget where the slider will be placed
- from_: the starting value of the slider
- to: the ending value of the slider
- orient: the orientation of the slider, can be HORIZONTAL or VERTICAL
- resolution: the incremental step value of the slider
- spinbox = Spinbox(root, from_=0, to=100)
- root: the parent widget where the spinbox will be placed
- from_: the starting value of the spinbox
- to: the ending value of the spinbox
- combobox = ttk.Combobox(root, values=["Option 1", "Option 2", "Option 3"])
- root: the parent widget where the combobox will be placed
- values: a list of options that will be displayed in the combobox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement