How to use list store

Hi, I want to create simple file manager using Ruby & Gtk3. I found an
example but they used python.

http://zetcode.com/gui/pygtk/advancedwidgets/

I didn’t understand structure of List Store how works? Also I read this
http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3AListStore

I couldn’t put any argument to store.append function so I used like
below:

@store = Gtk::ListStore.new(String, Gdk::Pixbuf, TrueClass)

Dir.foreach("/path/") {|x| @store.append; @store.set_value(x, dir_icon,
true)}

But it doesn’t work, how should I use List Store?

Thanks.

Hi,

In [email protected]
“[ruby-gnome2-devel-en] how to use list store” on Thu, 16 Jan 2014
17:18:46 +0100,
Ebru A. [email protected] wrote:

@store = Gtk::ListStore.new(String, Gdk::Pixbuf, TrueClass)

Dir.foreach("/path/") {|x| @store.append; @store.set_value(x, dir_icon,
true)}

But it doesn’t work, how should I use List Store?

Could you show the current whole your code?
It will be a good start point to improve it.

Thanks,

kou

Could you show the current whole your code?
It will be a good start point to improve it.

I found an example about list store and solved my problem.

https://github.com/ruby-gnome2/ruby-gnome2/blob/master/gtk2/sample/gtk-demo/iconview.rb

Thanks.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs