Class: Teek::Wm
- Inherits:
-
Object
- Object
- Teek::Wm
- Defined in:
- lib/teek/wm.rb
Overview
Prefer app.window(path) for new code - the same calls, without
repeating window: on every one when you're working with one window
repeatedly.
Thin, typed wrapper around Tk's wm (window manager) command family -
one method per subcommand, coerced to the right Ruby type, reached via
App#wm. Kept for callers already using app.wm.title(window: ...) -
every method here is a one-line delegate to Window, which is where
the actual wm/grab work now lives (see Window's own doc comment
for why - the same window-scoped operations kept growing as more and
more +window:+-kwarg methods flattened onto App).
Instance Method Summary collapse
-
#deiconify(window: '.') ⇒ void
Show a window (map it if withdrawn/iconified).
-
#geometry(window: '.') ⇒ String
Geometry string (e.g. +"400x300+0+0"+).
-
#initialize(app) ⇒ Wm
constructor
private
A new instance of Wm.
-
#resizable(window: '.') ⇒ Array(Boolean, Boolean)
[width_resizable, height_resizable].
-
#set_geometry(value, window: '.') ⇒ String
The geometry.
- #set_resizable(width, height, window: '.') ⇒ void
-
#set_title(value, window: '.') ⇒ String
The title.
-
#title(window: '.') ⇒ String
The window's current title.
-
#withdraw(window: '.') ⇒ void
Hide a window without destroying it.
Constructor Details
#initialize(app) ⇒ Wm
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Wm.
18 19 20 |
# File 'lib/teek/wm.rb', line 18 def initialize(app) @app = app end |
Instance Method Details
#deiconify(window: '.') ⇒ void
This method returns an undefined value.
Show a window (map it if withdrawn/iconified).
65 66 67 |
# File 'lib/teek/wm.rb', line 65 def deiconify(window: '.') @app.window(window).deiconify end |
#geometry(window: '.') ⇒ String
Returns geometry string (e.g. +"400x300+0+0"+).
37 38 39 |
# File 'lib/teek/wm.rb', line 37 def geometry(window: '.') @app.window(window).geometry end |
#resizable(window: '.') ⇒ Array(Boolean, Boolean)
Returns [width_resizable, height_resizable].
50 51 52 |
# File 'lib/teek/wm.rb', line 50 def resizable(window: '.') @app.window(window).resizable end |
#set_geometry(value, window: '.') ⇒ String
Returns the geometry.
44 45 46 |
# File 'lib/teek/wm.rb', line 44 def set_geometry(value, window: '.') @app.window(window).set_geometry(value) end |
#set_resizable(width, height, window: '.') ⇒ void
This method returns an undefined value.
58 59 60 |
# File 'lib/teek/wm.rb', line 58 def set_resizable(width, height, window: '.') @app.window(window).set_resizable(width, height) end |
#set_title(value, window: '.') ⇒ String
Returns the title.
31 32 33 |
# File 'lib/teek/wm.rb', line 31 def set_title(value, window: '.') @app.window(window).set_title(value) end |
#title(window: '.') ⇒ String
Returns the window's current title.
24 25 26 |
# File 'lib/teek/wm.rb', line 24 def title(window: '.') @app.window(window).title end |
#withdraw(window: '.') ⇒ void
This method returns an undefined value.
Hide a window without destroying it.
72 73 74 |
# File 'lib/teek/wm.rb', line 72 def withdraw(window: '.') @app.window(window).withdraw end |