Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
adding to FXRuby classes
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Brian Sheehan, post: 4439781"] Hi, I'm a newcomer to ruby so please bear with me! 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: class FXScrollbar alias orig_initialize initialize def initialize(*args) orig_initialize(*args) self.borderColor=FXColor::Green self.hiliteColor=FXColor::Green self.shadowColor=FXColor::Black self.backColor=FXColor::Black puts "End of my version of FXScrollbar initialize" end end 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? I'm using FXRuby-1.0.29, fox-1.2.9, ruby 1.6.8 on Mac OS X 10.3 Thanks for any help! Brian __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! [URL]http://promotions.yahoo.com/new_mail[/URL] [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
adding to FXRuby classes
Top