toplevel

Tkinter search bar [closed]

社会主义新天地 提交于 2019-12-20 07:53:28
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 days ago . Good day house. Please I want help on how to place a search box on my tkinter application toplevel so that my users can search for anything on each page. Here is my sample code (edited). import tkinter frame = tkinter.Tk() e1 = tkinter.Entry(frame) e1.grid(column=0, row=0) def text(): text = l.get()

New instance of toplevel classes make overlapping widgets

梦想与她 提交于 2019-12-13 22:16:09
问题 I'm generally new to python and tkinter. I've been programming maybe about a year or so, and I've just started to try to make each tkinter toplevel window its own class because I've heard that it's the right way to do it. I'm making a program in which I have a treeview with a button to add contents to it. The button opens up a new window that allows the user to input the contents. The problem I'm having is when I have to instantiate the first window to update the treeview, it seems like it's

How to set the size of a window? [duplicate]

无人久伴 提交于 2019-12-13 08:22:08
问题 This question already has an answer here : Set size of Tkinter window in Python [duplicate] (1 answer) Closed last year . How can I resize root window? try: # In order to be able to import tkinter for import tkinter as tk # either in python 2 or in python 3 except ImportError: import Tkinter as tk root = tk.Tk() tk.mainloop() How can I resize window ? try: # In order to be able to import tkinter for import tkinter as tk # either in python 2 or in python 3 except ImportError: import Tkinter as

Why is Toplevel showing 2 windows?

≯℡__Kan透↙ 提交于 2019-12-11 13:29:56
问题 I am trying to make a tkinter application which doesn't close everything (other windows) when the first window (root) is closed. I have tried to use Toplevel() which works perfectly for pop-up windows in other programs but not for making a base level. from tkinter import * top = Toplevel(bg='red') top.mainloop() I don't know if this is possible or I don't know if I can change the Tk() 's properties to make it so it doesn't shut all other windows down. 回答1: There are two windows getting

NSInvalidArgumentException - 'Invalid top-level type in JSON write' - Swift

无人久伴 提交于 2019-12-10 14:56:34
问题 As mentioned in the title of post,I'm getting NSInvalidArgumentException - 'Invalid top-level type in JSON write' when trying to convert Dictionary to JSON Data in swift let userInfo: [String: String] = [ "user_name" : username!, "password" : password!, "device_id" : DEVICE_ID!, "os_version" : OS_VERSION ] let inputData = jsonEncode(object: userInfo) . . . static private func jsonEncode(object:Any?) -> Data? { do{ if let encoded = try JSONSerialization.data(withJSONObject: object, options:[])

Python Tkinter, destroy toplevel after function

谁都会走 提交于 2019-12-10 09:52:27
问题 I'm programming some drives with python using Tkinter as GUI. When my machine is running, I'd like to show the user a toplevel window with some information which should close itself after the function completes. This is my minimal example: from Tkinter import * import time def button_1(): window = Toplevel() window.title("info") msg = Message(window, text='running...', width=200) msg.pack() time.sleep(5.0) window.destroy() master = Tk() frame = Frame(width=500,height=300) frame.grid() button

Python Tkinter, destroy toplevel after function

徘徊边缘 提交于 2019-12-06 02:57:53
I'm programming some drives with python using Tkinter as GUI. When my machine is running, I'd like to show the user a toplevel window with some information which should close itself after the function completes. This is my minimal example: from Tkinter import * import time def button_1(): window = Toplevel() window.title("info") msg = Message(window, text='running...', width=200) msg.pack() time.sleep(5.0) window.destroy() master = Tk() frame = Frame(width=500,height=300) frame.grid() button_one = Button(frame, text ="Button 1", command = button_1) button_one.grid(row = 0, column = 0, sticky =

How can I make area outside toplevel unclickable?

做~自己de王妃 提交于 2019-12-05 05:49:01
问题 I want to create a toplevel window in tkinter, and I want the outside area unclickable. So this way, the user cannot click out from the toplevel window, just after it's been destroyed. (And also preventing to be able to create the same window from the root Tk()) 回答1: Tkinter supports something called a "grab". When you put a grab on a window, all events are funneled through the widget. Even if you click outside the window, the click will register with the window. There are two types of grabs:

How can I make area outside toplevel unclickable?

余生颓废 提交于 2019-12-03 21:09:20
I want to create a toplevel window in tkinter, and I want the outside area unclickable. So this way, the user cannot click out from the toplevel window, just after it's been destroyed. (And also preventing to be able to create the same window from the root Tk()) Tkinter supports something called a "grab". When you put a grab on a window, all events are funneled through the widget. Even if you click outside the window, the click will register with the window. There are two types of grabs: local and global. Local means the grab only works for your application -- you can still click on the

I can not set title of top level

≡放荡痞女 提交于 2019-12-02 15:54:50
问题 I want to set title for TopLevel, but TopLevel shows title of Root. I think that my next script corresponds with examples from TkInter documentation, but gives me bad result. Cann You explain me, why my setting master.title = 'Top' in class AppTop does not set new title for TopLevel? import tkinter as tk class AppTop(tk.Frame): def __init__(self, master): mon_h = 900 mon_w = 1250 master.title = 'Top' tk.Frame.__init__(self, master) master.minsize(height = 900, width = 600) fr_button = tk