Subject: Re: [Newbies] How to modify ScrollPane example2 to enable scrolling by scroll wheel?

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Subject: Re: [Newbies] How to modify ScrollPane example2 to enable scrolling by scroll wheel?

JohnReed Maffeo
>>I can not figure out how to get scrolling by scroll wheel to work in ScrollPane example2. I have been poking around using explorer to >>try and figure out how the scroll wheel works in the Browser but have not discovered/recognized how it is supposed to work.
>>I have built an application based on ScrollPane example2 and it is working well, but it would be nice to get the scroll wheel to work >>before I get started on version 2.0. If I can get scrolling to work in the example, I think I can get it to work in my app.

>The scroll wheel actually generates keyboard events (ctrl-up/down/left/right). You need to make sure the ScrollPane gets these keyboard >events. See ScrollPane>>keyStroke:. Or you could call the ScrollPane's scrollByKeyboard: method in your own key stroke handler.
>- Bert -

Thanks for your prompt reply. I spent most of Saturday trying to put your suggestion to work, but I could not figure out how to get the scroll event to operate on a higher level morph. Scroll wheel / arrow

I am working in class ScrollPane to create a new example that demonstrates the behavior I am interested in. in example2, the scroll behavior is active at the lowest level of the morph tree, aTextMorph. I need to know how to tell aTextMorph how to ignore the key events  123, 124, 125, and 126, and then push up to a higher level. The next higher level is aPastUpMorph, next up is aScrollPane. You suggested that I ensure that aScrollPane gets the events but I am at a loss as to where to begin.

I did look at ScrollPane's #keystroke: and #scrollByKeyboard: methods and tried several experiments to make things work, but I am still stuck.

Any additional suggestions you could make would be greatly appreciated. In the meantime, I am going to start over and see it any lights turn on.


Beginners mailing list
[hidden email]