[fxruby-users] Problems with FXIconList and Icons
Jeroen van der Zijp
jeroen at fox-toolkit.org
Thu Jun 22 09:24:10 EDT 2006
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 Jede
Its 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. |
+----------------------------------------------------------------------------+
More information about the fxruby-users
mailing list