5 class Handle (gtk
.EventBox
):
7 gtk
.EventBox
.__init
__ (self
)
8 self
.set_visible_window (False)
9 self
.set_size_request (10, -1)
12 gdk
.BUTTON_PRESS_MASK | \
13 gdk
.BUTTON_RELEASE_MASK | \
14 gdk
.BUTTON1_MOTION_MASK
)
16 self
._move
_begined
= False
18 def do_button_press_event (self
, event
):
20 self
._move
_begined
= True
21 self
._press
_pos
= event
.x_root
, event
.y_root
22 self
.window
.set_cursor (gdk
.Cursor (gdk
.FLEUR
))
26 def do_button_release_event (self
, event
):
28 self
._move
_begined
= False
30 self
.window
.set_cursor (gdk
.Cursor (gdk
.LEFT_PTR
))
35 def do_motion_notify_event (self
, event
):
36 if not self
._move
_begined
:
38 toplevel
= self
.get_toplevel ()
39 x
, y
= toplevel
.get_position ()
40 x
= int (x
+ event
.x_root
- self
._press
_pos
[0])
41 y
= int (y
+ event
.y_root
- self
._press
_pos
[1])
43 self
._press
_pos
= event
.x_root
, event
.y_root
45 def do_expose_event (self
, event
):
46 self
.style
.paint_handle (
53 self
.allocation
.x
, self
.allocation
.y
,
54 10, self
.allocation
.height
,
55 gtk
.ORIENTATION_VERTICAL
)
58 gobject
.type_register (Handle
, "IBusHandle")