Social Icons

Thursday, September 10, 2020

The Widget Tkinter Frame

About the Frame Tkinter widget

A frame is simply a container for other widgets. Each frame has its own positioning manager. Thus, the layout of the widgets in each frame is independent. Frame widgets are good tools for making your application modular. You can group a consistent set of widgets by placing them in a frame. Better yet, you can create your own frame class by inheriting it from Frame, and making your own interface for that frame. This is a good technique for hiding the details of the interactions of a group's widgets.

Syntaxe

widget_frame = Frame (master, option, ...)
  1. master: represents the parent window.
  2. options: list of the most commonly used options for this widget. These options can be used as key-value pairs separated by commas.

List of options of a Frame widget

  1. bg: Frame widget background color
  2. bd: size of the borders around the Frame.
  3. cursor: allows you to customize the pattern of the mouse cursor when hovering.
  4. height: defines the vertical dimension of the Frame.
  5. highlightbackground: sets the color of the highlightbackground of the Frame object.
  6. highlightcolor:
  7. relief: with the default relief = FLAT, the checkbox does not stand out from its background. You can set this option to any other style.
  8. width: defines the width of the frame

Example

from tkinter import *

# Creation of the main window
master = Tk ()
master.geometry ("400x200")

# Creation of a green background frame
frm = Frame (master, bg = 'green')

# Frame location
frm.place (x = 50, y = 20, width = 200, height = 75)

# Creation of a button within the frame
b = Button (frm, text = "a button", bg = 'red', fg = 'white')
b.place (x = 10, y = 10, width = 100, height = 30)
master.mainloop()
The body widget may be very critical for the procedure of grouping and organizing different widgets in a in some way friendly manner. it works like a box, that is chargeable for arranging the position of different widgets. It makes use of rectangular regions within the display screen to organize the layout and to provide padding of these widgets. A body can also be used as a basis class to implement complex widgets. Syntax here is the easy syntax to create this widget − w = frame ( master, choice, ... ) Parameters grasp − This represents the determine window. alternatives − right here is the list of most generally used alternatives for this widget. those options can be used as key-cost pairs separated by means of commas. Sr.No. choice & Description cursor: in case you set this selection to a cursor name (arrow, dot and so on.), the mouse cursor will trade to that pattern while it's miles over the checkbutton. highlightbackground: colour of the point of interest spotlight while the frame does now not have consciousness. The default width of a checkbutton is determined via the size of the displayed photograph or text. you can set this option to some of characters and the checkbutton will always have room for that many characters.


Younes Derfoufi
my-courses.net

No comments:

Post a Comment

Category Of Mobile Courses

Actualités (644) Adsense (1) Affiliation (1) Algebraic Topology (1) Algorithmic (1) all-news (30) Android (5) Android App (8) Android app without code (4) Android Apps (169) Android Development (4) Android download (2) Android OS (3) AngularJS (1) Automata theory and formal language (5) C programming (5) Category and Functor (8) CMS (3) Computer Glossary (18) Create Mobile App With Ionic Framework (2) CSS (2) CSS-Cascading-Style-Sheets (4) Developpement Java (13) Differential Geometry (1) Django-Python-Framework (8) dropshiping (26) Earn Money by Internet (4) Emplois (23) Framework php (2) Fraud (2) HTML (7) Java For Beginners (10) Javascript (12) Kotlin Programming Language (8) Kotlin For Mobile Android (1) Linux Download (2) Marketing (5) Mobile (3) Mobile Courses (4) Mobile Marketing (4) MoneyGram (1) News (721) Node.js (5) Open Source (1) Photoshop (1) Protect Computer (1) Python (33) Python BeautifulSoup (1) Python For Data Science (2) Python-Books (6) Python-DVD-Training (1) Python-Exercises (140) Python-Framework (1) Python-IDE (1) Python-Modules (1) Python-pdf (2) Python-pyQt (1) Référencement (2) Script PHP (2) Security (6) SEO (1) Snipping Tool: Faq (1) Social Networks (1) Source Code (1) Statistics With SPSS (2) Surveillance Software (1) Travail à domicile (6) Tutoriels php en vidéos (2) Tutoriels-MySql (6) tutoriels-php (19) Utilitaires (1) VPS (1) Web Hosting (1) Webcam (1) Webmarketing (11) Western Union (1) Windows 10 (1) Windows 7 (4) Windows 7 Faq (2) Windows 8 (1) Windows Accessories (1) Windows Download (8) Windows Drivers (1) Windows Fonts (1) Windows Power Shell (2) Windows Registry (2) Windows Security (18) Windows Software (2) Windows Spyware (2) Windows utilities (3) Windows Virus (2) Windows Vista (3) Windows Wireless (1) Windows xp (1) Wordpress (1)
 

Sample text

Sample Text

 
Blogger Templates