in reply to Re: Stop mouse wheel from moving charts up/down Tk::Scrolled
in thread Stop mouse wheel from moving charts up/down Tk::Scrolled

I congratulate you on getting the code to run!

I am also on Active State 5.10.1, WinXP but I am so far unable to get this to run. I see the first chart drawn, then a LONG pause, then abend with output as above.

Binding specific button presses is tricky.
So far I haven't gotten to "first base", i.e. getting the OP's code to run. Any suggestions?
I've never see this: [BE CARREFUL] message before.

Replies are listed 'Best First'.
Re^3: Stop mouse wheel from moving charts up/down Tk::Scrolled
by thundergnat (Deacon) on Jan 18, 2012 at 20:17 UTC

    I started looking at it before the OP posted the links to his db, so I just hacked up some dummy data.

    I blanked out the dates and update_data routines since they didn't seem pertinent to the problem:

    sub dates {} sub update_data{}

    Then put in some dummy data at the top just after the @dataX arrays were declared:

    @data0 = @data1 = @data2 = @data3 =([0..200], [300..500]);

    That got me able to run the script to try and troubleshoot. Lots of 'uninitialized' warnings, but it ran at least. Putting "no warnings qw/uninitialized/;" at the top reduced that clutter.

    UPDATE: FWIW here is the actual code I tested with:

    UPDATE 2: Crap. It needs some further modifications to work correctly under Linux. Added some lines to the render{} subroutine to rebind the scroll buttons if you aren't running under Win32.

      Thanks!

      This explains a lot!

      I was just trying to run the OP's claimed "working" code and the OP's .db file. That didn't work. Apparently the reason why this "doesn't work" is because "it simply doesn't work". You modified the data such that it did work. Duh!

      I would ask the OP in a situation like this to post simple runnable code!

      Requiring some Monk like thundergnat to fix the code in order to run it is not the best way.

        I don't use this on a win32 system. It is purely designed to run on Linux. I've shrunk the database: http://pashanoid.ru/code/wind.db and code is http://pashanoid.ru/code/chart.pl these should be in same directory. When the charts are rendered and you hover your mouse over one of the charts and move the mouse wheel, that particular chart will move up or down. How on earth do I stop this???
      I don't use this on a win32 system. It is purely designed to run on Linux. I've shrunk the database: http://pashanoid.ru/code/wind.db and code is http://pashanoid.ru/code/chart.pl these should be in same directory. When the charts are rendered and you hover your mouse over one of the charts and move the mouse wheel, that particular chart will move up or down. How on earth do I stop this???

        Did you look at / try the code I posted the the previous node? Particularly the code I added to the render{} subroutine so it would work under Linux?

        If you download that script and test it, does it act as you would expect? It does for me.