M
Michael Gebhart
Hi there,
I'm just writing my first ruby-gtk application. But already there are the
first problems
In my application I have a treeview with 2 columns. In the second column,
I wanna display some text, that works. In the first column I'm trying to
display an image. It should be a image from an external server. So first I
have to grab the image, but how should I do that? After that I have to
display it in the treeview, but this also doesn't work. Here are my first
tries:
@treeview = @glade.get_widget("treeview")
@treestore = Gtk::TreeStore.new(Gdk:ixbuf, String)
@treeview.model = @treestore
@renderer = Gtk::CellRendererText.new
col = Gtk::TreeViewColumn.new("Image", @renderer, nil)
@treeview.append_column(col)
col = Gtk::TreeViewColumn.new("Description", @renderer, :text => 0)
#What is the :text => for? I know, that are attributes. But what can I set
here?
@treeview.append_column(col)
#Inserting an element
newStore = @treestore.append(nil)
newStore[0] = Gtk::Image.new("http://myurl/meinpicture.png")
newStore[1] = "test"
This does not work. Any ideas?
Greetings
Mike
I'm just writing my first ruby-gtk application. But already there are the
first problems
In my application I have a treeview with 2 columns. In the second column,
I wanna display some text, that works. In the first column I'm trying to
display an image. It should be a image from an external server. So first I
have to grab the image, but how should I do that? After that I have to
display it in the treeview, but this also doesn't work. Here are my first
tries:
@treeview = @glade.get_widget("treeview")
@treestore = Gtk::TreeStore.new(Gdk:ixbuf, String)
@treeview.model = @treestore
@renderer = Gtk::CellRendererText.new
col = Gtk::TreeViewColumn.new("Image", @renderer, nil)
@treeview.append_column(col)
col = Gtk::TreeViewColumn.new("Description", @renderer, :text => 0)
#What is the :text => for? I know, that are attributes. But what can I set
here?
@treeview.append_column(col)
#Inserting an element
newStore = @treestore.append(nil)
newStore[0] = Gtk::Image.new("http://myurl/meinpicture.png")
newStore[1] = "test"
This does not work. Any ideas?
Greetings
Mike