class ItemImage

this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint(dpblnt@gmail.com)

Attributes

item[R]

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/PrintEditor/ItemInfo/ItemImage.rb, line 7
def initialize
        super(Gtk::ListStore.new(Integer,String,Gdk::Pixbuf))
        frenderer=Gtk::CellRendererText.new
        irenderer=Gtk::CellRendererPixbuf.new
        pack_start(frenderer,true).add_attribute(frenderer,:text,1).
        pack_start(irenderer,true).add_attribute(irenderer,:pixbuf,2)
                DrbImages.instance.client_each{|image_id,im|
                        i=model.append
                        i[0]=im.image_id
                        i[1]=im.filename
                        i[2]=im.resize(32)
                }
        signal_connect("changed"){|me| @item.set_text(me.active_iter[0].to_s) unless me.active_iter.nil? or @item.nil?}
end

Public Instance Methods

update(item) click to toggle source
# File lib/PrintEditor/ItemInfo/ItemImage.rb, line 22
def update(item)
        @item=item
        found=nil
        model.each{|model,path,iter| found=iter if @item.text.to_i == iter[0]}
        if found then set_active_iter(found) else set_active(-1) end
        self
end