MiaouwScrolledWindow

MiaouwScrolledWindow — Implements drag scrolling and kinetic scrolling

Synopsis




            MiaouwScrolledWindowPrivate;
            MiaouwScrolledWindow;
GtkWidget*  miaouw_scrolled_window_new      (GtkAdjustment *hadjustment,
                                             GtkAdjustment *vadjustment);
void        miaouw_scrolled_window_activate_scrolling
                                            (MiaouwScrolledWindow *scrolled_window,
                                             GtkWidget *widget);
gboolean    miaouw_scrolled_window_is_drag_scrolled
                                            (MiaouwScrolledWindow *scrolled_window);
void        miaouw_scrolled_window_set_drag_scrolling
                                            (MiaouwScrolledWindow *scrolled_window,
                                             gboolean panning);
void        miaouw_scrolled_window_set_scrolling_hints
                                            (MiaouwScrolledWindow *scrolled_window,
                                             gboolean enabled);

Object Hierarchy


  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBin
                                 +----GtkScrolledWindow
                                       +----MiaouwScrolledWindow

Implemented Interfaces

MiaouwScrolledWindow implements AtkImplementorIface and GtkBuildable.

Description

A scrolled window derived from GtkScrolledWindow that implements drag scrolling and kinetic scrolling. Can be used as a drop-in replacement for the existing GtkScrolledWindow.

If a direct child of the MiaouwScrolledWindow has its own window (InputOnly is enough for events), it is automatically activated when added as a child. All motion events in that area will be used to scroll.

If some descendant widgets capture button press, button release and/or motion nofity events, an user can not scroll the area by pressing those widgets (unless the widget is activated). GtkButton is a typical example of that. Usually that is the desired behaviour.

Any widget can be registered to provide pointer events for the MiaouwScrolledWindow by using the miaouw_scrolled_window_activate_scrolling function.

Details

MiaouwScrolledWindowPrivate

typedef struct _MiaouwScrolledWindowPrivate MiaouwScrolledWindowPrivate;


MiaouwScrolledWindow

typedef struct _MiaouwScrolledWindow MiaouwScrolledWindow;


miaouw_scrolled_window_new ()

GtkWidget*  miaouw_scrolled_window_new      (GtkAdjustment *hadjustment,
                                             GtkAdjustment *vadjustment);

Similar function than the gtk_scrolled_window_new.

hadjustment : a horizontal GtkAdjustment
vadjustment : a vertical GtkAdjustment
Returns :

miaouw_scrolled_window_activate_scrolling ()

void        miaouw_scrolled_window_activate_scrolling
                                            (MiaouwScrolledWindow *scrolled_window,
                                             GtkWidget *widget);

Activates the widget so that pointer motion events inside the widget are used to scroll the MiaouwScrolledWindow. The widget can be a child of the MiaouwScrolledWindow or even a separate widget ("touchpad" style).

The direct child of the MiaouwScrolledWindow (typically GtkViewport) is activated automatically when added. This function has to be used if indirect descendant widgets are stopping propagation of the button press and release as well as motion events (for example GtkButton is doing so) but scrolling should be possible inside their area too.

This function adds GDK_BUTTON_PRESS_MASK, GDK_BUTTON_RELEASE_MASK, GDK_POINTER_MOTION_MASK, and GDK_MOTION_HINT_MAKS into the widgets event mask.

scrolled_window : a MiaouwScrolledWindow
widget : a GtkWidget of which area is made active event source for drag and kinetic scrolling.

miaouw_scrolled_window_is_drag_scrolled ()

gboolean    miaouw_scrolled_window_is_drag_scrolled
                                            (MiaouwScrolledWindow *scrolled_window);

scrolled_window :
Returns :

miaouw_scrolled_window_set_drag_scrolling ()

void        miaouw_scrolled_window_set_drag_scrolling
                                            (MiaouwScrolledWindow *scrolled_window,
                                             gboolean panning);

scrolled_window :
panning :

miaouw_scrolled_window_set_scrolling_hints ()

void        miaouw_scrolled_window_set_scrolling_hints
                                            (MiaouwScrolledWindow *scrolled_window,
                                             gboolean enabled);

scrolled_window :
enabled :

See Also

GtkScrolledWindow