Enable full screen using seesaw?
Asked Answered
B

1

8

How can I make my seesaw program full screen when F11 is pressed? (not just maximized)

I currently have this:

(defn toggle-full-screen [e]
  (-> (to-root e)
    magic!)

(def full-screen-action  (action  :name "Full Screen" :tip "Full Screen"     
                                  :mnemonic \f        :key (keystroke "F11")
                                  :handler toggle-full-screen))
(def view-menu (menu  :text "View"
                      :mnemonic \v
                      :items [full-screen-action]))

(def top-menubar (menubar :items [view-menu]))
[...]

toggle-full-screen runs when F11 is pressed however I can't figure out how to make the frame fullscreen.

Brumal answered 10/2, 2012 at 0:16 Comment(1)
Why was this downvoted? I'm very curious since it's quite an old question. Still relevant though and not a duplicate, badly worded, etc.Brumal
I
6

Caveat scriptor, I haven't tried this in seesaw but I think this is mostly about directly leveraging what is available in swing.

The following suggests what can be done with the swing API: http://weblogs.java.net/blog/mkarg/archive/2010/01/03/fullscreen-mode-cool

Also: http://docs.oracle.com/javase/tutorial/extra/fullscreen/index.html

At least part of the trick is to call setUndecorated on the frame.

I haven't investigated how you get at the necessary swing objects within seesaw yet.

Infrequent answered 10/2, 2012 at 17:7 Comment(2)
This seems right. Seesaw doesn't wrap the Swing objects at all so you can call setUndecorated directly on the result of (to-root e) in toggle-full-screen.Secure
Yes, the linked article works just fine with Seesaw. In fact, bleeding edge Seesaw now supports it directly: github.com/daveray/seesaw/blob/develop/test/seesaw/test/…Secure

© 2022 - 2024 — McMap. All rights reserved.