from Tkinter import *
import sys

Root=Tk()
RTitle=Root.title("Windows")
RWidth=Root.winfo_screenwidth()
RHeight=Root.winfo_screenheight()
Root.geometry("%dx%d")%(RWidth,RHeight))

mainloop()


Hello. When I run this code the window takes up the entire screen(win7).but remains below the bottom of the window portion of the taskbar. Even if the screen size is changed automatically carry out this.According to the height and width of the window to the taskbar. How can I do it?
Thanks

Edited 6 Years Ago by xleon: n/a

I don't have Windows 7 but the code you posted has a syntax error.

#Root.geometry("%dx%d")%(RWidth,RHeight) #_tkinter.TclError: bad geometry specifier "%dx%d"
#Replace with the following line
Root.geometry("%dx%d+0+0" % (RWidth, RHeight))

from Tkinter import *
import sys

Root=Tk()
RTitle=Root.title("Windows")
RWidth=Root.winfo_screenwidth()
RHeight=Root.winfo_screenheight()
Root.geometry(("%dx%d")%(RWidth,RHeight))

mainloop()

I forgot a bracket there. I corrected it. can you try again? thanks

Edited 6 Years Ago by xleon: n/a

That runs OK for me. I get a full-size blank window with "Windows" title bar. There's no scroll bar so I assume it fits as it should. My platform is Linux so maybe your problem is specific to Windows 7.

No it's not a specific problem. You should use:

root.minsize(min_x, min_y)
root.maxsize(max_x, max_y)

Also, use code tags. If you want the window to be a fixed size, I just set the minimum and maximum as the same. I've got a youtube video explaining stuff about Tkinter windows. Infact, I have a whole 10 video tutorial series to help people with Tkinter.

Tutorial 1: (click the links on the right to find the next ones)
http://www.youtube.com/watch?v=46FVOXPXAcY

Tk window tutorial: (the bit you want is at 3:20)
http://www.youtube.com/watch?v=Anrl1HX2ZHI


Hope this helps! (If so, please upvote!)

Edited 6 Years Ago by SgtMe: n/a

I have 19" monitor. .winfo_screenwidth=1440 and .winfo_screenheight=900.

from Tkinter import *
import sys
Root=Tk()
RTitle=Root.title("Windows")
Root.minsize(1000,450)
Root.maxsize(1400,850)
Root.geometry(1400,850)
mainloop()

if you want to run on 1024*600 what ll do it?
my problem: when Tkinter window display on screen I cant see status bar.
I cant see status bar. because its under task bar.
thanks for answers

from Tkinter import *
import sys

Root=Tk()
RTitle=Root.title("Windows")
RWidth=Root.winfo_screenwidth()
RHeight=Root.winfo_screenheight()
Root.geometry(("%dx%d")%(RWidth,RHeight))


class StatusBar(Frame):
    def __init__(self, master):
        Frame.__init__(self, master)
        self.label = Label(self, bd=1, relief=SUNKEN, anchor=W)
        self.label.pack(fill=X)
    def set(self, format, *args):
        self.label.config(text=format % args)
        self.label.update_idletasks()
    def clear(self):
        self.label.config(text="")
        self.label.update_idletasks()
status=StatusBar(Root)
status.pack(side=BOTTOM, fill=X)
Root.mainloop()

Edited 6 Years Ago by xleon: n/a

This article has been dead for over six months. Start a new discussion instead.