Teek API Documentation

Thin, typed wrapper around Tk’s winfo command family - one method per subquery, coerced to the right Ruby type, reached via App#winfo.

Grouped behind a single accessor instead of a dozen-plus flat App methods, since winfo is itself one big, well-known Tcl command namespace - knowing Tcl’s winfo width gets you to #width directly. Every method accepts a path String or anything that responds to to_s with one (a Widget, for instance).

Inherits: Object

Instance Methods

class_name(path)

Parameters
  • path String, Widget

Returns String — the Tk widget class (e.g. "TButton", "Frame")

exists?(path)

Parameters
  • path String, Widget

Returns Boolean — whether a window currently exists at path

height(path)

Parameters
  • path String, Widget

Returns Integer — current height in pixels

initialize(app)

Returns Winfo — a new instance of Winfo

@api private

ismapped?(path)

Parameters
  • path String, Widget

Returns Boolean — whether the window is currently mapped (actually displayed)

pointerx(path '.')

Parameters
  • path String, Widget — any window on the same screen (default: the root window)

Returns Integer — the mouse pointer's current x coordinate, in screen pixels

pointery(path '.')

Parameters
  • path String, Widget — any window on the same screen (default: the root window)

Returns Integer — the mouse pointer's current y coordinate, in screen pixels

reqheight(path)

Parameters
  • path String, Widget

Returns Integer — requested (natural) height in pixels

reqwidth(path)

Parameters
  • path String, Widget

Returns Integer — requested (natural) width in pixels

rootx(path)

Parameters
  • path String, Widget

Returns Integer — x coordinate of the window's top-left corner, in screen pixels

rooty(path)

Parameters
  • path String, Widget

Returns Integer — y coordinate of the window's top-left corner, in screen pixels

width(path)

Parameters
  • path String, Widget

Returns Integer — current width in pixels

x(path)

Parameters
  • path String, Widget

Returns Integer — x coordinate relative to the parent widget

y(path)

Parameters
  • path String, Widget

Returns Integer — y coordinate relative to the parent widget