using Gtk; public class ScrollingLabel : Gtk.ScrolledWindow { private Gtk.Label label; private double way; public string text { get { return this.label.get_text (); } set { this.label.set_text (value); } } public ScrollingLabel (string text) { this.text = text; this.hscrollbar_policy = Gtk.PolicyType.NEVER; this.vscrollbar_policy = Gtk.PolicyType.NEVER; } public static bool foo (ScrollingLabel self) { self.hadjustment.value += self.way; if (self.hadjustment.value <= self.hadjustment.lower || self.hadjustment.value >= self.hadjustment.upper) { self.way = -self.way; } } construct { this.label = new Gtk.Label (""); this.add_with_viewport (this.label); GLib.Timeout.add (10, foo, this); this.way = (this.hadjustment.upper - this.hadjustment.lower) / 10.0; } public static int main (string[] args) { Gtk.init (ref args); var window = new Gtk.Window (Gtk.WindowType.TOPLEVEL); window.add (new ScrollingLabel ("Test")); window.destroy += Gtk.main_quit; window.show_all (); Gtk.main (); return 0; } }