Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No mouse-scrolling in Pane objects?

The following Pane object does not scroll when the mouse wheel is used. Does anyone experience the same behaviour? Is it the default behaviour? Any idea why? Could it be platform-specific?

CreateDialog[Pane[Column[Range[30]], {300, 200}, Scrollbars -> True]]

My platform: Win7-64, Mathematica 8.0.1

like image 633
István Zachar Avatar asked Oct 02 '11 15:10

István Zachar


1 Answers

An alternative solution:

Needs["GUIKit`"]
ref = GUIRun[
   Widget["Panel", {
     Widget["ScrollPane", {
       "viewportView" -> Widget["List", {
          "visibleRowCount" -> 4,
          "items" -> Script[Range[30]]
          }] }] }]
   ];

The problem with Pane is that the MouseWheel event is not bound, as it is in GUIKit. Using this technique you could also do Bind["MouseWheel" ...] to any other action.

like image 179
Dr. belisarius Avatar answered Nov 13 '22 20:11

Dr. belisarius