Top | ![]() |
![]() |
![]() |
![]() |
GtkAdjustment * | hadjustment | Read / Write / Construct |
gboolean | kinetic-scrolling | Read / Write |
GtkAdjustment * | vadjustment | Read / Write / Construct |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkScrolledSyncWindow
GtkScrolledSyncWindow is a copy of GtkScrolledWindow that can be used as a companion widget. For this one will share some or all of the adjustments of the master widget with this widget. The GtkScrolledSyncWindow will never show scrollbars, instead it will follow the scrollbars of the master widget.
GtkWidget * gtk_scrolled_sync_window_new (GtkAdjustment *hadjustment
,GtkAdjustment *vadjustment
);
Creates a new synced scrolled window.
The two arguments are the scrolled window's adjustments; these will be
shared with the scrollbars and the child widget to keep the bars in sync
with the child. Usually you want to pass NULL
for the adjustments, which
will cause the scrolled window to create them for you.
void gtk_scrolled_sync_window_set_hadjustment (GtkScrolledSyncWindow *self
,GtkAdjustment *hadjustment
);
Sets the GtkAdjustment for the horizontal scrollbar.
void gtk_scrolled_sync_window_set_vadjustment (GtkScrolledSyncWindow *self
,GtkAdjustment *vadjustment
);
Sets the GtkAdjustment for the vertical scrollbar.
GtkAdjustment *
gtk_scrolled_sync_window_get_hadjustment
(GtkScrolledSyncWindow *self
);
Returns the horizontal adjustment.
GtkAdjustment *
gtk_scrolled_sync_window_get_vadjustment
(GtkScrolledSyncWindow *self
);
Returns the vertical adjustment.
void gtk_scrolled_sync_window_add_with_viewport (GtkScrolledSyncWindow *self
,GtkWidget *child
);
gtk_scrolled_sync_window_add_with_viewport
has been deprecated since version 3.8 and should not be used in newly-written code.
gtk_container_add() will now automatically add a GtkViewport if the child doesn't implement GtkScrollable.
Used to add children without native scrolling capabilities. This
is simply a convenience function; it is equivalent to adding the
unscrollable child to a viewport, then adding the viewport to the
scrolled window. If a child has native scrolling, use
gtk_container_add()
instead of this function.
The viewport scrolls the child by moving its GdkWindow, and takes the size of the child to be the size of its toplevel GdkWindow. This will be very wrong for most widgets that support native scrolling; for example, if you add a widget such as GtkTreeView with a viewport, the whole widget will scroll, including the column headings. Thus, widgets with native scrolling support should not be used with the GtkViewport proxy.
A widget supports scrolling natively if it implements the GtkScrollable interface.
void gtk_scrolled_sync_window_set_kinetic_scrolling (GtkScrolledSyncWindow *self
,gboolean kinetic_scrolling
);
Turns kinetic scrolling on or off.
Kinetic scrolling only applies to devices with source
GDK_SOURCE_TOUCHSCREEN
.
gboolean
gtk_scrolled_sync_window_get_kinetic_scrolling
(GtkScrolledSyncWindow *self
);
Returns the specified kinetic scrolling behavior.
void gtk_scrolled_sync_window_set_capture_button_press (GtkScrolledSyncWindow *self
,gboolean capture_button_press
);
Changes the behaviour of self
wrt. to the initial
event that possibly starts kinetic scrolling. When capture_button_press
is set to TRUE
, the event is captured by the scrolled window, and
then later replayed if it is meant to go to the child widget.
This should be enabled if any child widgets perform non-reversible
actions on “button-press-event”. If they don't, and handle
additionally handle “grab-broken-event”, it might be better
to set capture_button_press
to FALSE
.
This setting only has an effect if kinetic scrolling is enabled.
gboolean
gtk_scrolled_sync_window_get_capture_button_press
(GtkScrolledSyncWindow *self
);
Return whether button presses are captured during kinetic
scrolling. See gtk_scrolled_sync_window_set_capture_button_press()
.
“hadjustment”
property“hadjustment” GtkAdjustment *
The GtkAdjustment for the horizontal position.
Flags: Read / Write / Construct
“kinetic-scrolling”
property“kinetic-scrolling” gboolean
The kinetic scrolling behavior flags. Kinetic scrolling
only applies to devices with source GDK_SOURCE_TOUCHSCREEN
Flags: Read / Write
Default value: TRUE
“vadjustment”
property“vadjustment” GtkAdjustment *
The GtkAdjustment for the vertical position.
Flags: Read / Write / Construct
“move-focus-out”
signalvoid user_function (GtkScrolledSyncWindow *scrolled_sync_window, GtkDirectionType direction_type, gpointer user_data)
The ::move-focus-out signal is a
keybinding signalwhich gets emitted when focus is moved away from the scrolled
window by a keybinding.
The “move-focus” signal is emitted with direction_type
on this scrolled windows toplevel parent in the container hierarchy.
The default bindings for this signal are
and
Tab+Ctrl+Shift.scrolled_sync_window |
||
direction_type |
either |
|
user_data |
user data set when the signal handler was connected. |
Flags: Action
“scroll-child”
signalgboolean user_function (GtkScrolledSyncWindow *scrolled_sync_window, GtkScrollType scroll, gboolean horizontal, gpointer user_data)
The ::scroll-child signal is a
keybinding signalwhich gets emitted when a keybinding that scrolls is pressed. The horizontal or vertical adjustment is updated which triggers a signal that the scrolled windows child may listen to and scroll itself.
scrolled_sync_window |
||
scroll |
a GtkScrollType describing how much to scroll |
|
horizontal |
whether the keybinding scrolls the child horizontally or not |
|
user_data |
user data set when the signal handler was connected. |
Flags: Action