Dirk Schwendemann
2006-Apr-05 14:45 UTC
[fxruby-users] intercepting messages from FXScrollBartoFXScrollArea
Hello Jeroen, Henon and Lyle,
I''ve tried to overload the layout method of FXText with this:
def layout()
super()
scrollCorner.destroy()
verticalScrollBar.resize(verticalScrollBar.width, height)
end
This works as long as the user doesn''t use the keyboard to enter text
into
the textfield. It seems, as if user actions (e.g entering text with the
keyboard)trigger the layout method of FXText directly without calling the
overloaded ruby method.
I''ve added a SEL_CHANGED handler to the TextField to catch these events
and
correct the Scrollbar. This approach works, if notify=true is used in all
calls to appendText and appendStyledText.
I also tried to put a "next 0" at the end of the SEL_CONFIGURE message
handler of my first trial:
@scrollArea.verticalScrollBar.connect(SEL_CONFIGURE){
...
next 0
}
Unfortunately this doesn''t work neither - probably because the original
target has been overwritten by the connect command.
Nevertheless the scroll down button is now at the place I wanted it to be.
Thank you for your time and advice
Dirk
--
Echte DSL-Flatrate dauerhaft f?r 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl