{"action":"created","issue":{"url":"https://api.github.com/repos/ruby-gnome2/ruby-gnome2/issues/463","labels_url":"https://api.github.com/repos/ruby-gnome2/ruby-gnome2/issues/463/labels{/name}","comments_url":"https://api.github.com/repos/ruby-gnome2/ruby-gnome2/issues/463/comments","events_url":"https://api.github.com/repos/ruby-gnome2/ruby-gnome2/issues/463/events","html_url":"https://github.com/ruby-gnome2/ruby-gnome2/issues/463","id":90644556,"number":463,"title":"Best way to itterate over a Gtk::ListStore","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-24T11:08:46Z","updated_at":"2015-06-24T16:33:10Z","closed_at":null,"body":"What is the best way to iterate through a Gtk::ListStore. I have this so far:\r\n\r\n```ruby\r\nrequire \"gtk3\"\r\n\r\nmodel = Gtk::ListStore.new(TrueClass, String)\r\n\r\niter = model.append\r\niter[0] = false\r\niter[1] = \"item1\"\r\niter = model.append\r\niter[0] = false\r\niter[1] = \"item2\"\r\niter = model.append\r\niter[0] = false\r\niter[1] = \"item3\"\r\n\r\niter = model.iter_first\r\nputs model.get_value(iter, 1) \r\nwhile(model.iter_next(iter)) do\r\n  puts model.get_value(iter, 1) \r\nend\r\n```\r\n\r\n@kou \r\nI haven't see any script related to the basic usage of  a list store (creation, add/ remove/modify value, iterate). Maybe it could be a good start ."},"comment":{"url":"https://api.github.com/repos/ruby-gnome2/ruby-gnome2/issues/comments/114934719","html_url":"https://github.com/ruby-gnome2/ruby-gnome2/issues/463#issuecomment-114934719","issue_url":"https://api.github.com/repos/ruby-gnome2/ruby-gnome2/issues/463","id":114934719,"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-06-24T16:33:10Z","updated_at":"2015-06-24T16:33:10Z","body":"Sorry but I closed it whitout testing. When I test I have an error:\r\n\r\n```ruby\r\nmodel = Gtk::ListStore.new(TrueClass, String)\r\n\r\n(1..5).each do |i|\r\n  model.append(false,\"item#{i}\")\r\nend\r\n```\r\n\r\nerror message:\r\n```\r\n/home/cedlemo/.gem/ruby/2.2.0/gems/gtk3-2.2.6/lib/gtk3/list-store.rb:47:in `append': wrong number of arguments (2 for 0) (ArgumentError)\r\n```\r\n\r\nAnd\r\n\r\n```ruby\r\nmodel = Gtk::ListStore.new(TrueClass, String)\r\n\r\n(1..5).each do |i|\r\n  model.append.set_values(false, \"item#{i}\")\r\nend\r\n```\r\n\r\nError message:\r\n\r\n    combobox_from_cellrender.rb:8:in `block in <main>': undefined method `set_values' for #<Gtk::TreeIter:0x13fc7c0 ptr=0x1c20b40 own=true> (NoMethodError)"}}