Class: Gemba::HelpWindow

Inherits:
Object
  • Object
show all
Includes:
ChildWindow, Locale::Translatable
Defined in:
lib/gemba/help_window.rb

Overview

Floating hotkey reference panel toggled by pressing ‘?’.

Non-modal — no grab, no focus steal. Positioned to the right of the main window via ChildWindow#position_near_parent. AppController pauses emulation while the panel is visible and restores play on close.

Constant Summary collapse

TOP =
'.help_window'

Instance Method Summary collapse

Methods included from ChildWindow

#build_toplevel, #hide_window, #position_near_parent, #show_modal, #show_window, #withdraw

Constructor Details

#initialize(app:, hotkeys:) ⇒ HelpWindow

Returns a new instance of HelpWindow.



15
16
17
18
19
# File 'lib/gemba/help_window.rb', line 15

def initialize(app:, hotkeys:)
  @app     = app
  @hotkeys = hotkeys
  build_toplevel(translate('settings.hotkeys'), geometry: '220x400') { build_ui }
end

Instance Method Details

#hideObject



22
# File 'lib/gemba/help_window.rb', line 22

def hide    = hide_window(modal: false)

#showObject



21
# File 'lib/gemba/help_window.rb', line 21

def show    = show_window(modal: false)

#visible?Boolean

Returns:

  • (Boolean)


23
# File 'lib/gemba/help_window.rb', line 23

def visible? = @app.tcl_eval("wm state #{TOP}") == 'normal'