ScrolledView
Object Hierarchy:
Description:
public class ScrolledView : Widget
App-owned vertical scroll shell (GTK Gtk.ScrolledWindow model, without fighting measure).
Based on GTK `gtkscrolledwindow.c` allocate/measure: viewport size is independent of content; a Gtk.Scrollable
child gets the viewport allocation and scrolls via shared adjustments.
Vertical size is exactly content_height (min = nat). Classic
vertical scrollbar only when at max_height and `vadjustment.upper
> page_size` (hidden while the viewport still grows).
When the child is a Gtk.TextView, set_child
binds `buffer.changed` (one Idle) to set content_height
from line yrange (capped by max_height). Scroll-to-end is applied
in size_allocate after the TextView updates its
adjustment.
Usage Examples
Composer TextView
var scroll = new OLLMchatGtk.ScrolledView();
scroll.max_height = half_chat;
scroll.set_child(text_view); // auto-sizes on buffer.changed
Since:
1.0
Content:
Properties:
- public int content_height { get; set; }
Viewport height we report and allocate (pixels). For a TextView child
this is driven from buffer.changed.
- public Adjustment hadjustment { get; }
Shared with scrollable child (horizontal — usually unused).
- public Widget? line_peer { get; set; }
When set, empty / one visual line height matches this widget's natural
height (composer play button). Multi-line uses yrange.
- public int max_height { get; set; }
Cap for TextView auto-height; 0 = uncapped.
- public Adjustment vadjustment { get; }
Shared with scrollable child; drives classic scrollbar.
Creation methods:
Methods:
Signals:
- public signal void lines_changed (int lines)
After TextView yrange fit:
content_height updated. lines: 0 empty, 1 one
visual line (yrange ≤ glyph row), 2 more than one. Height may still use
line_peer when content fits the play-button row.
Inherited Members:
All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref
All known members inherited from interface Gtk.Accessible
- accessible_role
- announce
- get_accessible_parent
- get_accessible_role
- get_at_context
- get_bounds
- get_first_accessible_child
- get_next_accessible_sibling
- get_platform_state
- reset_property
- reset_relation
- reset_state
- set_accessible_parent
- update_next_accessible_sibling
- update_property
- update_property_value
- update_relation
- update_relation_value
- update_state
- update_state_value
All known members inherited from interface Gtk.Buildable
- add_child
- custom_finished
- custom_tag_end
- custom_tag_start
- get_buildable_id
- get_id
- get_internal_child
- parser_finished
- set_buildable_property
- set_id