コード例 #1
0
def on_mouse_down(widget, event):
    global down
    global mouse_prev
    global owner

    on_mouse_move(widget, event)

    print 'DOWN', event.button
    down = True

    mouse_prev = [event.x, event.y]
    #owner = 'mainimage'

    if owner == helpicon.ownerstr and event.button == 1:
        helpicon.help_on = not helpicon.help_on
        helpicon.needs_update = True

    if owner == imagemanager.ownerstr[1] and event.button == 1:
        imagemanager.on_click_preview(widget, event)

    print 'does event type match up with gtkgdk2button?', event.type == gtk.gdk._2BUTTON_PRESS
    print 'the current owner is', owner
    if owner == mainimage.ownerstr and event.type == gtk.gdk._2BUTTON_PRESS:
        'center that image'
        mainimage.center_image()

    if owner == navigator.ownerstr and down:
        navigator.click_on_navigator(event)
    elif owner == imagemanager.ownerstr[0] and down:
        imagemanager.update_winheight(widget, event)
コード例 #2
0
def on_mouse_move(widget, event):
    global mouse_prev

    #print 'mouse pos: {', event.x, ', ', event.y, '}'

    if not down:
        check_mouse_over(widget, event)

    if owner == 'mainimage' and down:
        mainimage.pos_x += event.x - mouse_prev[0]
        mainimage.pos_y += event.y - mouse_prev[1]
        mainimage.needs_update = True

    if owner == navigator.ownerstr and down:
        navigator.click_on_navigator(event)

    if owner == imagemanager.ownerstr[0] and down:
        imagemanager.update_winheight(widget, event)

    mouse_prev = [event.x, event.y]