scrolling during a DND operation?



hi,

during a DND operation in a ctree widget i want to scroll my 
parent widget (scrolled_window) if the mouse is over the ctree
columns headers. but here i have two problems.

in my DND motion callback i check if the coordinates are
inside my column headers. if yes i do the following:

if (y <= clist->column_title_area.height) {
        /* scroll up the "scrolled window"
         */
        GdkEventButton event;
        event.window =
            GTK_RANGE(
            GTK_SCROLLED_WINDOW(
                win->scroll_w)->vscrollbar) ->step_back;
        event.x = event.y = 1;
        event.send_event = TRUE;
        event.button = 1;
        event.state = 0;

        event.type = GDK_BUTTON_PRESS;
        event.time = gdk_time_get();
        gdk_event_put ((GdkEvent *)&event);

        event.type = GDK_BUTTON_RELEASE;
        event.time = gdk_time_get();
        gdk_event_put ((GdkEvent *)&event);
        return (TRUE);
}

the two problems are:

- it seems the event is catched by the DND callbacks, cause the
  BUTTON_RELEASE ends up in a behaviour like a normal button
  release during the DND. bug or feature?

- the "scrolled window" doesn't scroll.

any idea? better methods to scroll the GTK_SCROLLED_WINDOW?

cu
 rasca
-- 
 /#- Internet eMail: thron@gmx.de, WWWeb: rasca.home.pages.de -#\
 \#- please do NOT quote these lines or other useless stuff! --#/



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