capturing mouse dragged events



How do I capture a mouse dragged event ?  I can capture both the mouse pressed 
and mouse released event from an eventbox signal.  I have tried the following 
but it does not output the "Mouse Moved".  thks for any help.

bool MainDialog::on_button_release_event(GdkEventButton* event) {
    if (event->type == GDK_BUTTON_RELEASE) {
        std::cout << "Released" << std::endl;
        return true;
    }
}
bool MainDialog::on_button_press_event(GdkEventButton* event) {
    if (event->type == GDK_DRAG_MOTION) {
        std::cout << "Mouse Moved" << std::endl;
        return true;
    }
}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]