Open rshk opened 8 years ago
Many Xdo methods have a signature like method(window, ...), but it would be nice to have window optional, and default to CURRENTWINDOW.
Xdo
method(window, ...)
CURRENTWINDOW
One alternative can be to swap arguments, but either:
One option might be to have some Window(window_id) object, whose methods are (in a controlled way!) equivalent to name = partial(name, window_id)
Window(window_id)
name = partial(name, window_id)
NOTE: we need to pass the Xdo instance as well along the way to Window
Window
import xdo x = xdo.Xdo() current_window = x.get_window() # Returns a Window(xdo, 0) some_id = x.get_window_at_mouse() some_window = x.get_window(some_id) # Returns a Window(xdo, window_id)
Many
Xdo
methods have a signature likemethod(window, ...)
, but it would be nice to have window optional, and default toCURRENTWINDOW
.One alternative can be to swap arguments, but either:
One option might be to have some
Window(window_id)
object, whose methods are (in a controlled way!) equivalent toname = partial(name, window_id)
NOTE: we need to pass the
Xdo
instance as well along the way toWindow