|
List Info
Thread: Problems with FXIconList and Icons
|
|
| Problems with FXIconList and Icons |

|
2006-06-22 11:03:12 |
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|LAYOU
T_FILL_Y|ICONLIST_MINI_ICONS|ICONLIST_EXTENDEDSELECT|ICONLIS
T_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", iconNonterm, iconNonterm)
nonterminallist.appendItem(newI)
...
end
Thanks a lot
Alexander Jede
_______________________________________________
fxruby-users mailing list
fxruby-users rubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/fxruby-users
|
|
| Problems with FXIconList and Icons |

|
2006-06-22 13:24:10 |
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|LAYOU
T_FILL_Y|ICONLIST_MINI_ICONS|ICONLIST_EXTENDEDSELECT|ICONLIS
T_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", iconNonterm, 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. |
+-----------------------------------------------------------
-----------------+
_______________________________________________
fxruby-users mailing list
fxruby-users rubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/fxruby-users
|
|
| Problems with FXIconList and Icons |

|
2006-06-22 14:04:21 |
With some help I found the problem at:
http:
//www.fox-toolkit.org/faq.html#ILLEGALICON
Alexander Jede
_______________________________________________
fxruby-users mailing list
fxruby-users rubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/fxruby-users
|
|
| Creating widgets -- automatigically? |

|
2006-06-23 13:15:12 |
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?
_______________________________________________
fxruby-users mailing list
fxruby-users rubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/fxruby-users
|
|
| setting the background color of a
combobox ? |

|
2006-06-30 14:40:34 |
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/d
e/go/topmail
_______________________________________________
fxruby-users mailing list
fxruby-users rubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/fxruby-users |
|
[1-5]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|