1, fonts (font)
General format: (' Times-10 bold ')
(' Times ', ten, ' bold ', ' italic ') in turn, indicate font, font size, bold, italic
2, the use of pictures (image)
Photo=photoimage (file= ' path.gif ')
Canvas = Canvas.create_image (Image=photo)
Tkinter only supports a few other formats, such as GIF and BMP, you want to insert other format pictures you need to import Pil;pip install a Third-party class library pillow
From PIL import image,imagetk
stipple= "gray25". has no effect unless the fill have been set to some color. See section 4.7, "Bitmaps".
Tags
The tags to is associated with the object, as a sequence of strings. See section 6.1.4, "Canvas tags".
Width
The Width of the border around the outside of the ellipse. Default is 1 pixel; See sections 4.1, "Dimensions" for possible values. If you set this to zero, the border is not appear. If you set this to zero and make the fill transparent
This paper is mainly based on colorsys implementation, the sample is from HLS to RGB, if you want to change the color space is very easy to modify only a function, the specific content is as follows
Scale and canvas components are used.
Run:
The code is as follows:
from Tkinter import * Import Colorsys #操作后的响应函数 def update (* args): ' color ' r,g,b = Colorsys.hl S_to_rgb (H.get ()/255.0, L.get ()/255.0, S.get ()/255.0) R,g,b = R * 255, G * 255, B *
The module ("Tk interface") isInterface of the standard Tk GUI toolkit. Tk andIt can be used on most Unix platforms,
It can also be applied in Windows and Macintosh systems. Later versions of Tk8.0 can implement local window styles and run well on most platforms.
Is a Python module with Tk interfaces,Library provides interfaces for Tk APIs,
It belongs to the GUI tool group of Tcl/Tk. Tcl/Tk is a writing and graphics device developed by John Ousterhout.
Tcl (tool command language) is a macro
of the dialog box. If this option is not specified, then a default title will be displayed.
[Source:]
Http://www.tcl.tk/man/tcl8.4/TkCmd/getOpenFile.htm
Http://www.tcl.tk/man/tcl8.4/TkCmd/chooseDirectory.htm
Example
This example just shoshould give you an idea of the modules use.
import Tkinter, Tkconstants, tkFileDialogclass TkFileDialogExample(Tkinter.Frame): def __init__(self, root): Tkinter.Frame.__init__(self, root) # options for but
Event:1 def evclear (): 2 lhistory['text'] = ehello.get ()3 ehello.delete (0, Tk. END)DescriptionThe text within the lhistory tag becomes the content of the Ehello input area, and then the text of the Ehello area is deleted.You can set the label text using a dictionary-style access method.Delete () uses 0 as the first argument, the description text begins, and the second parameter Tk. END. Represents a special value that represents the end of the text.python-Module-
1 #!/usr/bin/env python2 #-*-coding:utf-8-*-3 4 ImportTkinter as TK5 6 classFullscreenapp (object):7 def __init__(Self, master, * *Kwargs):8Self.root =Master9 #self.tk.attributes ('-zoomed ', True) # This just maximizes it so we can see the window. It 's nothing-to-do with fullscreen.TenSelf.frame =tk. Frame (self.root) One Self.frame.pack () ASelf.state =False -Self.root.bind ("", Self.toggle_fullscreen) -Self.root.bind ("", Self.end_fullscreen) the - defToggle_fullscreen (Self
again or another way to display
Place_slaves (): Returns all child component objects of this component in a list. [Slaves () has the same function]
Place_info (): Returns the value corresponding to the option provided by place.
fromTkinterImport*Root=Tk () root.geometry ('100x100') Label=label (text="User name:", bg='Green') Entry=Entry () label.pack (fill=X)#x, y#entry.place (x=0,y=0)#relx,rely#entry.place (relx=0.3, rely=0.3)#entry.place (relx=0.5,
-selected button state
Scale
A range control that displays a numeric scale that is a range of numbers for the output limit
Scrollbar
A scrollbar control that is used when the content exceeds a visual area, such as a list box ...
Text
Text control; for displaying multiple lines of text
TopLevel
A container control that provides a separate dialog box, similar to a frame
Spinbox
Input controls, similar to
Examples of dynamic variable usage in php and php variable usage. Examples of dynamic variable usage in php, and examples of php variable usage this article describes the dynamic variable usage in php. Share it with you for your reference. The specific analysis is as follows: fixed variables defined: examples of dynami
Chapter 1 common basic controls (1) -- Examples of the main interface in this chapter, Chapter 2 Examples
Category: C #, Android, VS2015;
Created on:
This chapter describes the basic usage of simple Android controls. There are nine examples of the source program in this chapter, all of which are in the same project.
Project name: ch05demos, Project template: Blan
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.