I'm looking for a functional example that would demonstrate how to make a Gtk+3 window full screen.
OK, I figured it out by reading the window state flags documentation:
win.connect("key-press-event", self.on_win_key_press_event)
win.connect("window-state-event", self.on_window_state_event)
#...
def fullscreen_mode(self):
if self.__is_fullscreen:
self.win.unfullscreen()
else:
self.win.fullscreen()
def on_win_key_press_event(self, widget, ev):
key = Gdk.keyval_name(ev.keyval)
if key == "f":
self.fullscreen_mode()
def on_window_state_event(self, widget, ev):
self.__is_fullscreen = bool(ev.new_window_state & Gdk.WindowState.FULLSCREEN)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With