티스토리 뷰
import tkinter #1. import
window = tkinter.Tk() #2. window 생성 후
#4. 이 둘 사이에 프로그램을 작성한다
window.mainloop() #3. 윈도우가 떠있게 하고
import tkinter
window = tkinter.Tk()
window.title("My First GUI Program(20220327) ")
window.minsize(width=500, height=300)
#Label
my_label = tkinter.Label(text="I am a Label", font=("Arial", 24, "bold"))
my_label.pack() #label이 표현될 위치 등 정보
window.mainloop()
*pack()
http://tcl.tk/man/tcl8.6/TkCmd/pack.htm
pack manual page - Tk Built-In Commands
The arguments consist of the names of one or more content windows followed by pairs of arguments that specify how to manage the content. See THE PACKER ALGORITHM below for details on how the options are used by the packer. The following options are support
tcl.tk
The Packer
The packer is one of Tk’s geometry-management mechanisms. Geometry managers are used to specify the relative positioning of widgets within their container - their mutual master. In contrast to the more cumbersome placer (which is used less commonly, and we do not cover here), the packer takes qualitative relationship specification - above, to the left of, filling, etc - and works everything out to determine the exact placement coordinates for you.
The size of any master widget is determined by the size of the “slave widgets” inside. The packer is used to control where slave widgets appear inside the master into which they are packed. You can pack widgets into frames, and frames into other frames, in order to achieve the kind of layout you desire. Additionally, the arrangement is dynamically adjusted to accommodate incremental changes to the configuration, once it is packed.
Note that widgets do not appear until they have had their geometry specified with a geometry manager. It’s a common early mistake to leave out the geometry specification, and then be surprised when the widget is created but nothing appears. A widget will appear only after it has had, for example, the packer’s pack() method applied to it.
The pack() method can be called with keyword-option/value pairs that control where the widget is to appear within its container, and how it is to behave when the main application window is resized. Here are some examples:
fred.pack() # defaults to side = "top"
fred.pack(side="left")
fred.pack(expand=1)
Packer Options
For more extensive information on the packer and the options that it can take, see the man pages and page 183 of John Ousterhout’s book.
anchorAnchor type. Denotes where the packer is to place each slave in its parcel.
expandBoolean, 0 or 1.
fillLegal values: 'x', 'y', 'both', 'none'.
ipadx and ipadyA distance - designating internal padding on each side of the slave widget.
padx and padyA distance - designating external padding on each side of the slave widget.
sideLegal values are: 'left', 'right', 'top', 'bottom'.
'Test > Python(20220101~)' 카테고리의 다른 글
Days27. Many keword Arguments (0) | 2022.04.08 |
---|---|
Days27. Many positional Arguments (0) | 2022.04.08 |
Days26. 입력하는 영단어를 NATO Phonetic Alphabet 으로 변환 (0) | 2022.03.26 |
Days26. Dictionary Comprehension (0) | 2022.03.17 |
Days26. List Comprehension (2) | 2022.03.14 |
- Total
- Today
- Yesterday
- set()
- storage
- fromkeys
- 중복제거
- 대소문자
- EXA
- dp-2
- 차집합
- LIST
- insert
- Join
- artandculture
- oracle
- 3par
- vmware
- 읽어오기
- 배열
- 정렬
- vmware.powercli
- sysprep
- dp-1
- 스토리지
- powershell
- dezoomify
- exadata
- cloud-init
- virt-sysprep
- 부동없이
- 변수화
- powercli
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |