Help improving with tkinter /u/Ranch1k Python Education

Do you guys have any idea on how can I improve this python tkinter widget that I am making to create a jarvis like program, and how to remove the white border in the button?

import tkinter as tk from tkinter import PhotoImage from tkinter import ttk from tkinter import * from PIL import ImageTk def open_secondary_window(): # Create secondary (or popup) window. secondary_window = tk.Toplevel() secondary_window.title("Apps") secondary_window.config(width=1950, height=1800, background="purple") # Create a button to close (destroy) this window. button_close = ttk.Button( secondary_window, text="Batcave", command=secondary_window.destroy ) button_close.place(x=5, y=5) # Create the main window. root = tk.Tk() root.config(width=1800, height=800) root.title("Batcave.V1") root.attributes('-fullscreen',True) # Create a button inside the main window that # invokes the open_secondary_window() function # when pressed. jarvis = "jarvisbg.png" canvas = tk.Canvas(root, width=1920, height=1750) canvas.pack() tk_img = ImageTk.PhotoImage(file = jarvis) canvas.create_image(960, 540, image=tk_img) button_exit = ttk.Button(root, text="Exit", command=root.destroy) button_open = ttk.Button(root, text="Apps Room", command=open_secondary_window) button_exit.place(x=5, y=50) button_open.place(x=5, y=5) root.mainloop() 

submitted by /u/Ranch1k
[link] [comments]

​r/learnpython Do you guys have any idea on how can I improve this python tkinter widget that I am making to create a jarvis like program, and how to remove the white border in the button? import tkinter as tk from tkinter import PhotoImage from tkinter import ttk from tkinter import * from PIL import ImageTk def open_secondary_window(): # Create secondary (or popup) window. secondary_window = tk.Toplevel() secondary_window.title(“Apps”) secondary_window.config(width=1950, height=1800, background=”purple”) # Create a button to close (destroy) this window. button_close = ttk.Button( secondary_window, text=”Batcave”, command=secondary_window.destroy ) button_close.place(x=5, y=5) # Create the main window. root = tk.Tk() root.config(width=1800, height=800) root.title(“Batcave.V1”) root.attributes(‘-fullscreen’,True) # Create a button inside the main window that # invokes the open_secondary_window() function # when pressed. jarvis = “jarvisbg.png” canvas = tk.Canvas(root, width=1920, height=1750) canvas.pack() tk_img = ImageTk.PhotoImage(file = jarvis) canvas.create_image(960, 540, image=tk_img) button_exit = ttk.Button(root, text=”Exit”, command=root.destroy) button_open = ttk.Button(root, text=”Apps Room”, command=open_secondary_window) button_exit.place(x=5, y=50) button_open.place(x=5, y=5) root.mainloop() submitted by /u/Ranch1k [link] [comments] 

Do you guys have any idea on how can I improve this python tkinter widget that I am making to create a jarvis like program, and how to remove the white border in the button?

import tkinter as tk from tkinter import PhotoImage from tkinter import ttk from tkinter import * from PIL import ImageTk def open_secondary_window(): # Create secondary (or popup) window. secondary_window = tk.Toplevel() secondary_window.title("Apps") secondary_window.config(width=1950, height=1800, background="purple") # Create a button to close (destroy) this window. button_close = ttk.Button( secondary_window, text="Batcave", command=secondary_window.destroy ) button_close.place(x=5, y=5) # Create the main window. root = tk.Tk() root.config(width=1800, height=800) root.title("Batcave.V1") root.attributes('-fullscreen',True) # Create a button inside the main window that # invokes the open_secondary_window() function # when pressed. jarvis = "jarvisbg.png" canvas = tk.Canvas(root, width=1920, height=1750) canvas.pack() tk_img = ImageTk.PhotoImage(file = jarvis) canvas.create_image(960, 540, image=tk_img) button_exit = ttk.Button(root, text="Exit", command=root.destroy) button_open = ttk.Button(root, text="Apps Room", command=open_secondary_window) button_exit.place(x=5, y=50) button_open.place(x=5, y=5) root.mainloop() 

submitted by /u/Ranch1k
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *