class TextscrollDemo
# Copyright © 2016 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. #
Text View/Automatic Scrolling¶ ↑
This example demonstrates how to use the gravity of GtkTextMarks to keep a text view scrolled to the bottom while appending text.
Public Class Methods
new(main_window)
click to toggle source
# File gtk3/sample/gtk-demo/textscroll.rb, line 12 def initialize(main_window) @window = Gtk::Window.new(:toplevel) @window.screen = main_window.screen @window.set_default_size(600, 400) hbox = Gtk::Box.new(:horizontal, 6) hbox.homogeneous = true @window.add(hbox) create_text_view(hbox, true) create_text_view(hbox, false) end
Public Instance Methods
run()
click to toggle source
# File gtk3/sample/gtk-demo/textscroll.rb, line 26 def run if !@window.visible? @window.show_all else @window.destroy end @window end