{"action":"created","issue":{"url":"https://api.github.com/repos/ruby-gnome2/ruby-gnome2/issues/605","labels_url":"https://api.github.com/repos/ruby-gnome2/ruby-gnome2/issues/605/labels{/name}","comments_url":"https://api.github.com/repos/ruby-gnome2/ruby-gnome2/issues/605/comments","events_url":"https://api.github.com/repos/ruby-gnome2/ruby-gnome2/issues/605/events","html_url":"https://github.com/ruby-gnome2/ruby-gnome2/issues/605","id":112700696,"number":605,"title":"Adjustment#value=","user":{"login":"ibrahimtencer","id":2914952,"avatar_url":"https://avatars.githubusercontent.com/u/2914952?v=3","gravatar_id":"","url":"https://api.github.com/users/ibrahimtencer","html_url":"https://github.com/ibrahimtencer","followers_url":"https://api.github.com/users/ibrahimtencer/followers","following_url":"https://api.github.com/users/ibrahimtencer/following{/other_user}","gists_url":"https://api.github.com/users/ibrahimtencer/gists{/gist_id}","starred_url":"https://api.github.com/users/ibrahimtencer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibrahimtencer/subscriptions","organizations_url":"https://api.github.com/users/ibrahimtencer/orgs","repos_url":"https://api.github.com/users/ibrahimtencer/repos","events_url":"https://api.github.com/users/ibrahimtencer/events{/privacy}","received_events_url":"https://api.github.com/users/ibrahimtencer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-21T23:41:30Z","updated_at":"2015-10-24T10:59:03Z","closed_at":null,"body":"So I'm using gtk3, and trying to get a TextView to scroll to the bottom every time the text is changed. My understanding is that the way to do this is by changing its vertical adjustment value. But, this doesn't work.\r\n\r\n    @field = Gtk::TextView.new\r\n    @scroll = Gtk::ScrolledWindow.new\r\n    @scroll.add(@field)\r\n\r\n    @field.buffer.signal_connect_after(\"changed\") do |b|\r\n      p @scroll.vadjustment.value #=> 0.0\r\n      p @scroll.vadjustment.upper #=> 608.0\r\n      @scroll.vadjustment.value = @scroll.vadjustment.upper\r\n      p @scroll.vadjustment.value #=> 0.0\r\n      true\r\n    end\r\n\r\nBut the value is of course updated internally when the scrollbar is dragged by the user. Is there a different way to do it or is this just a bug?"},"comment":{"url":"https://api.github.com/repos/ruby-gnome2/ruby-gnome2/issues/comments/150784227","html_url":"https://github.com/ruby-gnome2/ruby-gnome2/issues/605#issuecomment-150784227","issue_url":"https://api.github.com/repos/ruby-gnome2/ruby-gnome2/issues/605","id":150784227,"user":{"login":"cedlemo","id":1135841,"avatar_url":"https://avatars.githubusercontent.com/u/1135841?v=3","gravatar_id":"","url":"https://api.github.com/users/cedlemo","html_url":"https://github.com/cedlemo","followers_url":"https://api.github.com/users/cedlemo/followers","following_url":"https://api.github.com/users/cedlemo/following{/other_user}","gists_url":"https://api.github.com/users/cedlemo/gists{/gist_id}","starred_url":"https://api.github.com/users/cedlemo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cedlemo/subscriptions","organizations_url":"https://api.github.com/users/cedlemo/orgs","repos_url":"https://api.github.com/users/cedlemo/repos","events_url":"https://api.github.com/users/cedlemo/events{/privacy}","received_events_url":"https://api.github.com/users/cedlemo/received_events","type":"User","site_admin":false},"created_at":"2015-10-24T10:59:03Z","updated_at":"2015-10-24T10:59:03Z","body":"I have something that work for me could you confirm ?\r\n\r\n```ruby\r\nrequire 'gtk3'\r\n\r\nclass ScrollWindow < Gtk::Window\r\n  def initialize\r\n    super\r\n\r\n    signal_connect(\"destroy\") {Gtk.main_quit}\r\n    set_default_size 400, 400\r\n    @vbox = Gtk::Box.new(:vertical, 0)\r\n\r\n    @scroll = Gtk::ScrolledWindow.new\r\n    @scrollbar = @scroll.vscrollbar\r\n    @field = Gtk::TextView.new\r\n    @scroll.add(@field)\r\n\r\n    @vbox.pack_start(@scroll, expand: true, fill: true)\r\n    vadj = @scrollbar.adjustment\r\n    vadj.signal_connect \"changed\" do |a|\r\n      puts \"upper #{a.upper}\"\r\n      a.value = a.upper\r\n    end\r\n    button = Gtk::Button.new(label: \"Add and scroll\")\r\n    button.signal_connect \"clicked\" do\r\n      @field.buffer.text += \"h\\n\"*100\r\n#      adj = @scrollbar.adjustment\r\n#      puts \"lower #{adj.lower}\"\r\n#      puts \"old val #{adj.value}\"\r\n#      puts \"upper #{adj.upper}\"\r\n#      adj.value = adj.upper - adj.page_size\r\n#      puts \"after setting #{adj.value}\"\r\n    end\r\n    \r\n    @vbox.add(button)\r\n\r\n    add(@vbox)\r\n\r\n    show_all\r\n  end\r\nend\r\n\r\nwindow = ScrollWindow.new\r\nGtk.main\r\n```\r\nThe code is ugly but still readable."}}