Taking Over the Screen - Tkinter

Eric Brunel eric.brunel at N0SP4M.com
Thu Feb 26 10:55:15 CET 2004


Fuzzyman wrote:
> I'm working on a presentation program that needs to produce 'full
> screen' images.
> 
> The effect will be something like a powerpoint presentation.
> In actual fact it's a song database with lyrics - and each 'screen'
> will need a widget for next verse, previous verse, chorus etc..... so
> what I'd really like is a Tk text widget that is full screen sized.
> 
> (For the moment I'll just use a large window - most of the work will
> be in building the interface to the database).
> 
> How do I either -
> 
> 1) Produce a borderless full screen window *or*
> 2) Detect the window size
> 
> using Tkinter pereferably................
> 
> 
> Thanks,
> 
> Fuzzy
> 
> http://www.voidspace.org.uk/atlantibots/pythonutils.html

To produce a borderless window: method overrideredirect on Toplevel's; this 
makes the window manager (if that has any meaning on your platform) ignore the 
window, so it doesn't draw any decorations.

To get the size of the screen: methods winfo_screenwidth and winfo_screenheight 
on any Tkinter object.

To resize your window: method geometry on Toplevel's; the geometry is encoded in 
a string with the format "WxH+X+Y", so you'll want:
"%sx%s+0+0" % (w.winfo_screenwidth(), w.winfo_screenheight())

You may also have to explicitely call the method tkraise on your borderless 
window on Windows, because such windows have a tendency to appear below all 
other ones.

HTH
-- 
- Eric Brunel <eric dot brunel at pragmadev dot com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com




More information about the Python-list mailing list