28.10.2021 Views

Python Tutorial ( PDFDrive )

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

font

height

labelAnchor

highlightbackground

highlightcolor

highlightthickness

relief

text

The vertical dimension of the new frame.

The vertical dimension of the new frame.

Specifies where to place the label.

Color of the focus highlight when the frame does not have focus.

Color shown in the focus highlight when the frame has the focus.

Thickness of the focus highlight.

With the default value, relief=FLAT, the checkbutton does not stand out from its

background. You may set this option to any of the other styles

Specifies a string to be displayed inside the widget.

width

Example:

Specifies the desired width for the window.

Try the following example yourself. Here's how to create a labelframe widget:

from Tkinter import *

root = Tk()

labelframe = LabelFrame(root, text="This is a LabelFrame")

labelframe.pack(fill="both", expand="yes")

left = Label(labelframe, text="Inside the LabelFrame")

left.pack()

root.mainloop()

When the above code is executed, it produces the following result:

tkMessageBox

The tkMessageBox module is used to display message boxes in your applications. This module provides a

number of functions that you can use to display an appropriate message.

Some of these functions are showinfo, showwarning, showerror, askquestion, askokcancel, askyesno and

askretryignore.

TUTORIALS POINT

Simply Easy Learning

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!