Class: Fullscreen

Inherits:
Fox::FXMainWindow
  • Object
show all
Includes:
Fox, Responder
Defined in:
lib/piggy-gui/fullscreen.rb

Overview

Provide a validation hook for ID_ACCEPT action

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Fullscreen

Returns a new instance of Fullscreen.



11
12
13
14
# File 'lib/piggy-gui/fullscreen.rb', line 11

def initialize(*args)
  super(*args)
  FXMAPFUNC(SEL_KEYPRESS, 0, :on_key_press)
end

Instance Method Details

#on_key_press(sender, sel, event) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/piggy-gui/fullscreen.rb', line 16

def on_key_press(sender, sel, event)
  if event.code == KEY_Escape
    if FOXVERSION_GE_1_2
      close(true)
    else
      hide()
    end
    return 1
  end
  return 0
end