Tkinter fullscreen with Mac OS X

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • C Martin

    Tkinter fullscreen with Mac OS X

    Is there a way to create a full screen app using Tkinter with Mac OS
    X?? On windows, this is relatively easy with overrideredirec t(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.
  • Guilherme Polo

    #2
    Re: Tkinter fullscreen with Mac OS X

    On Mon, Jul 28, 2008 at 8:10 PM, C Martin <g.threepwood@g mail.comwrote:
    Is there a way to create a full screen app using Tkinter with Mac OS
    X?? On windows, this is relatively easy with overrideredirec t(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("::t k::unsupported: :MacWindowStyle ", "style", tl._w, "plain", "none")

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

    tl.wm_attribute s('-fullscreen', 1)

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


    --
    -- Guilherme H. Polo Goncalves

    Comment

    • C Martin

      #3
      Re: Tkinter fullscreen with Mac OS X

      On Jul 28, 6:43 pm, "Guilherme Polo" <ggp...@gmail.c omwrote:
      >
      You could try this, supposing tl is a toplevel:
      >
      tl.tk.call("::t k::unsupported: :MacWindowStyle ", "style", tl._w, "plain", "none")
      >
      I tried this (although, my tl is actually a tk instance):

      self.tk.call(": :tk::unsupporte d::MacWindowSty le", "style", self.tk._w,
      "plain", "none")

      and get this message:

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

      Any thoughts? Can you do something similar on the tk instance itself?

      Comment

      • Kevin Walzer

        #4
        Re: Tkinter fullscreen with Mac OS X

        C Martin wrote:
        On Jul 28, 6:43 pm, "Guilherme Polo" <ggp...@gmail.c omwrote:
        >You could try this, supposing tl is a toplevel:
        >>
        >tl.tk.call(":: tk::unsupported ::MacWindowStyl e", "style", tl._w, "plain", "none")
        >>
        >
        I tried this (although, my tl is actually a tk instance):
        >
        self.tk.call(": :tk::unsupporte d::MacWindowSty le", "style", self.tk._w,
        "plain", "none")
        >
        and get this message:
        >
        Traceback (most recent call last):
        File "./ProgramCountdow n.py", line 120, in <module>
        control = Controller(tk)
        File "./ProgramCountdow n.py", line 37, in __init__
        self.tk.call(": :tk::unsupporte d::MacWindowSty le", "style",
        self.tk._w, "plain", "none")
        _tkinter.TclErr or: 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_a ttributes(fulls creen='true')

        --
        Kevin Walzer
        Code by Kevin

        Comment

        Working...