Hi list, I am writing a small program where I want to display some objects in an IconList. For a better looking a choose an an .png and created a FXPNGIcon instance of it. When the program starts it creates an empty FXIconList and the Icons will initialized too. While using the program it should be possible to add some objects to the list. But if I run the program is crashes with this message: "FXDCWindow::drawIcon: illegal icon specified." I do not now what I had made wrong. Because if I insert some objects to the iconlist during the initialization (in de initialize method) it works great! The code looks like: def initialize() .... @iconNonterm = loadIcon("tb_buttonbx01.png") ... @nonterminallist FXIconList.new(nonterminalgroupbox,nil,0,LAYOUT_FILL_X|LAYOUT_FILL_Y|ICONLIST_MINI_ICONS|ICONLIST_EXTENDEDSELECT|ICONLIST_SINGLESELECT|ICONLIST_ROWS|ICONLIST_DETAILED) @nonterminallist.connect(SEL_RIGHTBUTTONPRESS,method(:onRightNonterm)) ... end def onRightNonterm(sender,sel,ptr) if !ptr.moved menu = FXMenuPane.new(sender) FXMenuCommand.new(menu,"Neu",nil,sender).connect(SEL_COMMAND, method(:onAddNonterm)) newI = FXIconItem.new("Bla", at iconNonterm, at iconNonterm) @nonterminallist.appendItem(newI) ... end Thanks a lot Alexander Jede
Jeroen van der Zijp
2006-Jun-22 13:24 UTC
[fxruby-users] Problems with FXIconList and Icons
On Thursday 22 June 2006 06:03, Alexander Jede wrote:> Hi list, > I am writing a small program where I want to display some objects in an > IconList. For a better looking a choose an an .png and created a > FXPNGIcon instance of it. > When the program starts it creates an empty FXIconList and the Icons > will initialized too. > While using the program it should be possible to add some objects to the > list. > But if I run the program is crashes with this message: > > "FXDCWindow::drawIcon: illegal icon specified." > > I do not now what I had made wrong. > Because if I insert some objects to the iconlist during the > initialization (in de initialize method) it works great! > > > The code looks like: > def initialize() > .... > @iconNonterm = loadIcon("tb_buttonbx01.png") > ... > @nonterminallist > FXIconList.new(nonterminalgroupbox,nil,0,LAYOUT_FILL_X|LAYOUT_FILL_Y|ICONLIST_MINI_ICONS|ICONLIST_EXTENDEDSELECT|ICONLIST_SINGLESELECT|ICONLIST_ROWS|ICONLIST_DETAILED) > @nonterminallist.connect(SEL_RIGHTBUTTONPRESS,method(:onRightNonterm)) > ... > end > def onRightNonterm(sender,sel,ptr) > if !ptr.moved > menu = FXMenuPane.new(sender) > FXMenuCommand.new(menu,"Neu",nil,sender).connect(SEL_COMMAND, > method(:onAddNonterm)) > newI = FXIconItem.new("Bla", at iconNonterm, at iconNonterm) > @nonterminallist.appendItem(newI) > ... > end > > Thanks a lot > Alexander JedeIts in the FAQ: http://www.fox-toolkit.org/faq.html#ILLEGALICON. - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 23:30 03/30/2006 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+
Alexander Jede
2006-Jun-22 14:04 UTC
[fxruby-users] [Solved] Problems with FXIconList and Icons
With some help I found the problem at: http://www.fox-toolkit.org/faq.html#ILLEGALICON Alexander Jede
Jeroen van der Zijp wrote:>>"FXDCWindow::drawIcon: illegal icon specified." > Its in the FAQ: http://www.fox-toolkit.org/faq.html#ILLEGALICON.Thats a good explanation, thanks for the pointer. I would not have thought of the subclassing problem. How about automatic creation? Methods that need "created" widgets could check if their parameters are already created, and if they are not, call create on them. Fox C++ library might not be the right place to do this. After all, you''d expect C++ interfaces to have (and enforce) very strict rules. I believe it would fit more into the FXRuby layer, and would probably be very easy to achieve with a nice metaprogramming hack. What do you think?
Axel Etzold
2006-Jun-30 14:40 UTC
[fxruby-users] setting the background color of a combobox ?
How do you set the bakcground color of a combobox ? I have a Combobox, which should have a white background color, yet it somewhat strangely inherits the gray color of the frame it sits in. I have tried to correct this by setting p = $settingsFrame p.recursive{|w| # w.baseColor=STD_BACK_COLOR next if w.kind_of? TextField next if w.backColor==HEADER_COLOR if /ComboBox/.match(w.type.to_s) w.baseColor=WHITE_BACK_COLOR w.backColor=WHITE_BACK_COLOR else w.backColor=STD_BACK_COLOR end } for WHITE_BACK_COLOR=FXRGB(255,255,255), and STD_BACK_COLR=FXRGB(128,128,128) but this changes the background color from gray to white only if I click on the combobox to show a dropdown of them. Then , everything becomes white, but after that, it turns to gray again. Thank you for your help, Axel -- "Feel free" ? 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail