toplevel

I can not set title of top level

牧云@^-^@ 提交于 2019-12-02 08:13:13
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.Frame(master) fr_button.place(relx=0.01, rely=0.06) butArrowPlus = tk.Button(fr_button, text=">", height =

How to remove minimize/maximize buttons while preserving the icon?

∥☆過路亽.° 提交于 2019-12-01 07:41:31
Is it possible to display the icon for my toplevel and root window after removing the minimize and maximize buttons? I tried using -toolwindow but the icon can't be displayed afterwards. Is there another way I can remove the min and max size buttons from window while still displaying the icon? from tkinter import * def top(): tp = Toplevel() tp.geometry("300x300") tp.attributes("-toolwindow", 1) tp.iconbitmap("My icon.ico") root = Tk() root.geometry("400x400") b = Button(root, text="open window with icon", command=top).pack() root.mainloop() Windows-specific solution First option is to make