|
Revision 1, 0.8 KB
(checked in by root, 3 years ago)
|
|
Initial commit
|
| Line | |
|---|
| 1 | def start_drag(c): |
|---|
| 2 | pass |
|---|
| 3 | # c.x = 0 |
|---|
| 4 | |
|---|
| 5 | def start_sweep(c): |
|---|
| 6 | pass |
|---|
| 7 | # c.width = 100 |
|---|
| 8 | # return False |
|---|
| 9 | |
|---|
| 10 | def stop_action(c): |
|---|
| 11 | print c.name |
|---|
| 12 | |
|---|
| 13 | import mwm |
|---|
| 14 | mwm.run() |
|---|
| 15 | mwm.set_drag_start_hook(start_drag) |
|---|
| 16 | mwm.set_drag_end_hook(stop_action) |
|---|
| 17 | mwm.set_sweep_start_hook(start_sweep) |
|---|
| 18 | mwm.set_sweep_end_hook(stop_action) |
|---|
| 19 | |
|---|
| 20 | def h(): |
|---|
| 21 | print 'hide' |
|---|
| 22 | mwm.focused().hide() |
|---|
| 23 | |
|---|
| 24 | def s(): |
|---|
| 25 | print 'show' |
|---|
| 26 | mwm.focused().show() |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | def active(c): |
|---|
| 30 | for w in mwm.list(): |
|---|
| 31 | w.unset_grab_button_mask() |
|---|
| 32 | print 'hop' |
|---|
| 33 | c.show() |
|---|
| 34 | c.focus() |
|---|
| 35 | c.set_grab_button_mask() |
|---|
| 36 | |
|---|
| 37 | mwm.set_mouse_button1_hook(active) |
|---|
| 38 | mwm.grab_keys([(49, 12, h), (50, 12, s)]) |
|---|
| 39 | |
|---|
| 40 | #tutorial: |
|---|
| 41 | #mwm.list() -> all active clients |
|---|
| 42 | #mwm.grab_keys -> ... |
|---|
| 43 | #mwm.focused() -> returns active client |
|---|
| 44 | |
|---|
| 45 | #available mathodes on Client object |
|---|
| 46 | #client.show() |
|---|
| 47 | #client.hide() |
|---|
| 48 | #client.focus() |
|---|