1 127
Подписчики
Нет данных24 часа
Нет данных7 дней
Нет данных30 день
Архив постов
1 127
# Create window with background image
from tkinter import *
class StartWindow:
def __init__(self, master):
master.geometry('1024x720') # window size
master.title("Window with background")
master.image = PhotoImage(file='E:/pp/water.png')
bg_label = Label(master, image=master.image)
bg_label.grid(row=0, column=0)
root = Tk()
my_gui = StartWindow(root)
root.mainloop()1 127
A very useful book for those who study python and tkinter. There are many information about methods and their parameters.
For those who learn only tkinter there are useful information from 415 page.
1 127
# Create main window
import tkinter
top = tkinter.Tk()
# Code to add widgets...
top.mainloop()
1 127
~ What's Tkinter ~
Tkinter is the standard GUI library for Python.
Creating a GUI application using Tkinter is an easy task. All you need to do is perform the following steps −
1) Import the Tkinter module.
2) Create the GUI application main window.
3) Add one or more of the above-mentioned widgets to the GUI application.
4) Enter the main event loop to take action against each event triggered by the user.
1 127
If you have problem with
" Wish.exe cannot be found while running page gui builder in python "
Install Activetcl
From
https://www.activestate.com/products/activetcl/downloads/
1 127
For simple developming you can install page gui generator, from this link
https://sourceforge.net/projects/page/
1 127
1 127
Method pack()
The manager handles all widgets that are packed inside the same master widget. The packing algorithm is simple, but a bit tricky to describe in words; imagine a sheet of some elastic material, with a very small rectangular hole in the middle. For each widget, in the order they are packed, the geometry manager makes the hole large enough to hold the widget, and then place it against a given inner edge (default is the top edge). It then repeats the process for all widgets. Finally, when all widgets have been packed into the hole, the manager calculates the bounding box for all widgets, makes the master widget large enough to hold all widgets, and moves them all to the master.
