B
Brian Sheehan
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!
http://promotions.yahoo.com/new_mail
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!
http://promotions.yahoo.com/new_mail