how to remove the background on text in tkinter python

Solutions on MaxInterview for how to remove the background on text in tkinter python by the best coders in the world

showing results for - "how to remove the background on text in tkinter python"
Madalyn
24 Feb 2016
1from tkinter import *
2from tkinter import messagebox
3import tkinter
4import hashlib
5from PIL import Image, ImageTk
6from win32api import GetSystemMetrics
7
8#===========================================================================================
9#functions to center windows
10def center_window_x(width):
11    x_coordinate = (GetSystemMetrics(0)/2) - (width/2)
12    return x_coordinate
13def center_window_y(height):
14    y_coordinate = (GetSystemMetrics(1)/2) - (height/2)
15    return y_coordinate
16
17
18#===========================================================================================
19#function to create setup page
20def first_time_setup(width, height):
21    setup_window = Tk()
22
23    #===========================================================================================
24    #remove window border and position in center
25    setup_window.overrideredirect(1)
26    setup_frame = Frame(setup_window)
27    setup_frame.pack_propagate(False)
28    setup_window.geometry('%dx%d+%d+%d' % (width, height, center_window_x(width), center_window_y(height)))
29
30    #===========================================================================================
31    #background image for setup window
32    canvas = Canvas(setup_window, width=width, height=height)
33    canvas.grid(columnspan=2)
34    image = Image.open("setup_background.jpg")
35    canvas.image = ImageTk.PhotoImage(image)
36    canvas.create_image(0, 0, image=canvas.image, anchor="nw")
37
38    #===================================================================================================
39    #add username label
40    start_title = Label(setup_window, text="Username")
41    start_title.place(x=430,y=225)
42
43    #===================================================================================================
44    #add admin user entry box 
45    admin_user_ent = Entry(setup_window)
46    admin_user_ent.place(x=500,y=225)
47
48first_time_setup(650, 300)
49