def start_drag(c): pass # c.x = 0 def start_sweep(c): pass # c.width = 100 # return False def stop_action(c): print c.name import mwm mwm.run() mwm.set_drag_start_hook(start_drag) mwm.set_drag_end_hook(stop_action) mwm.set_sweep_start_hook(start_sweep) mwm.set_sweep_end_hook(stop_action) def h(): print 'hide' mwm.focused().hide() def s(): print 'show' mwm.focused().show() def active(c): for w in mwm.list(): w.unset_grab_button_mask() print 'hop' c.show() c.focus() c.set_grab_button_mask() mwm.set_mouse_button1_hook(active) mwm.grab_keys([(49, 12, h), (50, 12, s)]) #tutorial: #mwm.list() -> all active clients #mwm.grab_keys -> ... #mwm.focused() -> returns active client #available mathodes on Client object #client.show() #client.hide() #client.focus()