| The Miaouw Library Reference Manual | ||||
|---|---|---|---|---|
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);
GObject
+----GInitiallyUnowned
+----GtkObject
+----GtkWidget
+----GtkContainer
+----GtkBin
+----GtkScrolledWindow
+----MiaouwScrolledWindow
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.
typedef struct _MiaouwScrolledWindowPrivate MiaouwScrolledWindowPrivate;
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 : |
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. |
gboolean miaouw_scrolled_window_is_drag_scrolled
(MiaouwScrolledWindow *scrolled_window);
scrolled_window : |
|
| Returns : |
void miaouw_scrolled_window_set_drag_scrolling
(MiaouwScrolledWindow *scrolled_window,
gboolean panning);
scrolled_window : |
|
panning : |
void miaouw_scrolled_window_set_scrolling_hints
(MiaouwScrolledWindow *scrolled_window,
gboolean enabled);
scrolled_window : |
|
enabled : |