From: Pierre Baillet Date: 2003-01-07T06:18:46+09:00 Subject: [BUG][FOX] iconlist and multiple icon usage --k1lZvvs/B4yU6o8G Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi, -- i've encountered a bug in the FOX library from the PragProg installer. When using a FXIconList, it does not seem to be possible to use the same FXIcon for more than 1 item in the list. Trying to do so result in a segfault on win2k (and win98se) at least. Attached you will find a simple test case (you just need to set FOLDER_OPEN to a valid png file on your system). I've tried to .clone the FXIcon but it says the icon was already detached or some kind of obscure error message related to, i guess, reference counting. FOX does seem to be quite sensitive on the icon topic and i've had hard time to figure where segfaults where coming from... I even started to believe that simple ruby code could make sefgault the interpreter :)) Apart from reinstancing an icon everytime, is there a solution to have icons used more than once on with FOX ? Thanks a lot, -- Pierre Baillet Tout avantage a ses inconv�nients et r�ciproquement. Devise Shadok --k1lZvvs/B4yU6o8G Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: attachment; filename="eicon_bug.rb" require "fox" include Fox class Foo < FXMainWindow include Responder FOLDER_OPEN = "icon/stock_open.png" def redraw_list @iconlist.clearItems # display empty boxes icon = FXPNGIcon.new(getApp(),@@folder_data) (1..3).each{ |f| item = FXIconItem.new(f.to_s, icon ) @iconlist.appendItem(item) } end def initialize @application = FXApp.new("foo", "Bar") @@folder_data= File.open(FOLDER_OPEN,"rb").read() super(@application, "COM Marker Viewer "+VERSION, nil, nil, DECOR_ALL, 0, 0,640, 480, 0, 0) frame = FXVerticalFrame.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y) @iconlist = FXIconList.new(frame,nil,0, ICONLIST_BIG_ICONS|ICONLIST_ROWS|ICONLIST_COLUMNS| LAYOUT_FILL_X|LAYOUT_FILL_Y) @application.create() self.show(PLACEMENT_SCREEN) redraw_list @application.run() end end Foo.new() --k1lZvvs/B4yU6o8G--