[Fxruby-users] Multi-colored FXList
Status: Inactive
Brought to you by:
lyle
|
From: Matthew M. <nam...@na...> - 2004-03-14 07:55:39
|
Hello, On the fifthplanet wiki I saw one answer to a question I hadn't asked yet ;^) The question dealt with subclassing FXList to draw the list items in different colors. Lyle provide a very good solution in C++. I'm wondering if, using his solution as a guide, the same result could be done using FXRuby. I thought I would ask and see if there were any gotchas before I tried an implementation in Ruby. I've one more question as well. The way that I'm learning FXRuby is to write a file manager that is similar to the one called sfm that was written using GTK+. When renaming a file in sfm the equivalent of a FXLabel is replaced by a one-line text field where the filename can be edited (i.e. the same way that the Windows Explorer works.) FXList doesn't support this behavior. Now I'm wondering how to write a widget to do what I want. I've looked at the C++ source for FXList and hope that here is an easy way to accomplish the behavior I see in sfm. After doing some reading I thought that I might could use a FXVerticalFrame to stack the widgets that show the filenames. The trouble is that I couldn't find a way to iterate through the contents of the frame and if necessary replace a FXLabel with a FXTextField object. Well, there is the FXWindow#children method in the FXVerticalFrame subclass, but would replacing an element in the returned array with a different widget affect the display? Well, for both these things I'm looking for some insight. Thanks. Matthew. -- Where it is a duty to worship the sun it is pretty sure to be a crime to examine the laws of heat. -- Christopher Morley |