python - How to have a proper tkinter window with Windows 8? -
i did research could, can't find answer. problem :
how make window take maximum size without taskbar overlapping ? don't want part of window under taskbar.
i tried using winfo_screenwidth , winfo_screen_height, nor root.state("zoomed") appear work : both resize window screen size, while want screen size minus taskbar.
edit : seeing how confused question seems : let h height of monitor screen in pixel , h_taskbar height in pixel of taskbar. how can make window take (h - h_taskbar) height ?( don't know h_taskbar !)
if want set fullscreen attribute true, easy as:
root = tk() root.attributes('-fullscreen', true) however, doesn't show title bar. if want keep visible, can resize tk element geometry()method:
root = tk() w, h = root.winfo_screenwidth(), root.winfo_screenheight() root.geometry("%dx%d+0+0" % (w, h)) with winfo_width() , winfo_height() can width , height or window, , can bind event handler <configure> event:
def resize(event): print("new size is: {}x{}".format(event.width, event.height)) root.bind("<configure>", resize)
Comments
Post a Comment