From: Lyle Johnson Date: 2004-08-24T04:52:32+09:00 Subject: Re: adding to FXRuby classes On Tue, 24 Aug 2004 04:44:09 +0900, Brian Sheehan wrote: > I'm using the FXRuby module to interface with the FOX > toolkit. I want to overide the default appearance of a > couple of the widgets, and I've been trying to do it > by replacing the initialize method of the widget with > my own version. Here's how I tried to do it for > FXScrollbar: > I can now create a instance of FXScrollbar, and it > displays with the expected colour change, and the puts > statement from my initialize method prints to the > terminal. However, when I subsequently create an > instance of FXList (which has a scrollbar), the > scrollbar is created without my replacement initialize > method being called at all (at least the puts is not > being printed to the terminal) and so the scrollbar > appears as normal. Does this seem like incorrect > behaviour, or am I missing something? As you may have deduced, the FXList class uses the stock version of FXScrollbar (from the C++ library) and doesn't know about any changes you've made to the Ruby version's initialize() method. However, you may still be able to get the effect you're after by first constructing the FXList instance: aList = FXList.new(...) and then accessing its horizontalScrollbar and verticalScrollbar members to make the desired changes, e.g. aList.horizontalScrollbar.borderColor=FXColor::Green aList.horizontalScrollbar.hiliteColor=FXColor::Green aList.horizontalScrollbar.shadowColor=FXColor::Black aList.horizontalScrollbar.backColor=FXColor::Black > I'm using FXRuby-1.0.29, fox-1.2.9, ruby 1.6.8 on Mac > OS X 10.3. I hope this is a typo, but you should be using one of the fox-1.0.x version libraries with FXRuby-1.0.29. fox-1.2.9 is definitely incompatible with FXRuby-1.0.29. Hope this helps, Lyle