Tkinter fullscreen with Mac OS X

Discussion in 'Python' started by C Martin, Jul 29, 2008.

  1. C Martin

    C Martin Guest

    Is there a way to create a full screen app using Tkinter with Mac OS
    X?? On windows, this is relatively easy with overrideredirect(1).
    However, on the Mac, the top menu bar and dock are still displayed
    over the app. Is there a way to get rid of them?

    Thanks.
    C Martin, Jul 29, 2008
    #1
    1. Advertising

  2. On Mon, Jul 28, 2008 at 8:10 PM, C Martin <> wrote:
    > Is there a way to create a full screen app using Tkinter with Mac OS
    > X?? On windows, this is relatively easy with overrideredirect(1).
    > However, on the Mac, the top menu bar and dock are still displayed
    > over the app. Is there a way to get rid of them?
    >


    You could try this, supposing tl is a toplevel:

    tl.tk.call("::tk::unsupported::MacWindowStyle", "style", tl._w, "plain", "none")

    and if you are using python with tk 8.5 or newer (unlikely):

    tl.wm_attributes('-fullscreen', 1)

    But I don't have a mac, so I can't say for sure if these solve your problem.

    > Thanks.
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >




    --
    -- Guilherme H. Polo Goncalves
    Guilherme Polo, Jul 29, 2008
    #2
    1. Advertising

  3. C Martin

    C Martin Guest

    On Jul 28, 6:43 pm, "Guilherme Polo" <> wrote:
    >
    > You could try this, supposing tl is a toplevel:
    >
    > tl.tk.call("::tk::unsupported::MacWindowStyle", "style", tl._w, "plain", "none")
    >


    I tried this (although, my tl is actually a tk instance):

    self.tk.call("::tk::unsupported::MacWindowStyle", "style", self.tk._w,
    "plain", "none")

    and get this message:

    Traceback (most recent call last):
    File "./ProgramCountdown.py", line 120, in <module>
    control = Controller(tk)
    File "./ProgramCountdown.py", line 37, in __init__
    self.tk.call("::tk::unsupported::MacWindowStyle", "style",
    self.tk._w, "plain", "none")
    _tkinter.TclError: bad class: should be alert, moveableAlert, modal,
    moveableModal, floating, help, or document

    Any thoughts? Can you do something similar on the tk instance itself?
    C Martin, Aug 7, 2008
    #3
  4. C Martin

    Kevin Walzer Guest

    C Martin wrote:
    > On Jul 28, 6:43 pm, "Guilherme Polo" <> wrote:
    >> You could try this, supposing tl is a toplevel:
    >>
    >> tl.tk.call("::tk::unsupported::MacWindowStyle", "style", tl._w, "plain", "none")
    >>

    >
    > I tried this (although, my tl is actually a tk instance):
    >
    > self.tk.call("::tk::unsupported::MacWindowStyle", "style", self.tk._w,
    > "plain", "none")
    >
    > and get this message:
    >
    > Traceback (most recent call last):
    > File "./ProgramCountdown.py", line 120, in <module>
    > control = Controller(tk)
    > File "./ProgramCountdown.py", line 37, in __init__
    > self.tk.call("::tk::unsupported::MacWindowStyle", "style",
    > self.tk._w, "plain", "none")
    > _tkinter.TclError: bad class: should be alert, moveableAlert, modal,
    > moveableModal, floating, help, or document
    >
    > Any thoughts? Can you do something similar on the tk instance itself?
    >



    Try something like this (assuming self.tk._w is the name of your window):

    self.tk._w.wm_attributes(fullscreen='true')

    --
    Kevin Walzer
    Code by Kevin
    http://www.codebykevin.com
    Kevin Walzer, Aug 7, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steffen Loringer

    Fullscreen of IE

    Steffen Loringer, Jan 29, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    453
    Anatoly
    Jan 29, 2004
  2. Steve F.
    Replies:
    3
    Views:
    1,790
    bruce barker
    Feb 10, 2005
  3. =?Utf-8?B?Sm9obiBCYW5raGVhZA==?=

    Fullscreen Mode

    =?Utf-8?B?Sm9obiBCYW5raGVhZA==?=, Apr 15, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    549
    =?Utf-8?B?Sm9obiBCYW5raGVhZA==?=
    Apr 18, 2005
  4. Ashak
    Replies:
    3
    Views:
    404
    Ashak
    Aug 28, 2003
  5. Replies:
    5
    Views:
    190
    Rotwang
    Apr 4, 2013
Loading...

Share This Page