Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Help with Scrolled Pane mouse wheel binds

by Phinix (Acolyte)
on Dec 10, 2012 at 23:55 UTC ( #1008191=note: print w/ replies, xml ) Need Help??


in reply to Help with Scrolled Pane mouse wheel binds

Hey Zen. Well, I saw that one actually, and tried it on my example above, which worked. Here is the code I used to test it:

#!/usr/local/bin/perl -w use strict; use Tk; require Tk::DynaMouseWheelBind; my $mw = new MainWindow; my @scrollables = ('Tk::Pane'); $mw->DynaMouseWheelBind(@scrollables); my $containerframe = $mw-> Frame()-> form(-left => '%0', -right => '%1 +00', -top => '%0', -bottom => '%100'); my $scrollpane = $containerframe->Scrolled('Pane', -scrollbars => 'oe' +, -sticky => 'nsew')-> form(-left => '%0', -right => '%100', -top => +'%0', -bottom => '%100'); $scrollpane = $scrollpane->Subwidget('scrolled'); my $innerframe = $scrollpane->Frame()-> form(-left => '%0', -right => +'%100', -top => '%0', -bottom => '%100'); $innerframe-> Label(-text => "test\n")-> pack for 1 .. 112; MainLoop;

However, when I try to incorporate it the exact same way into my working project I get errors:

error:window ".frame.notebook.page3.frame.frame.frame1.frame.pane" is +n't packed at C:/Perl/site/lib/Tk/Widget.pm line 1218, <PLUGINS> line 39. at C:/Perl/site/lib/Tk/After.pm line 90 Tk::Error: window ".frame.notebook.page3.frame.frame.frame1.frame.pane +" isn't pa cked at C:/Perl/site/lib/Tk/Widget.pm line 1218, <PLUGINS> l ine 39. at C:/Perl/site/lib/Tk/After.pm line 90 Tk callback for pack Tk::After::once at C:/Perl/site/lib/Tk/After.pm line 90 [once,[{},after#38,idle,once,[{},packscrollbars]]] ("after" script)


Comment on Re: Help with Scrolled Pane mouse wheel binds
Select or Download Code
Re^2: Help with Scrolled Pane mouse wheel binds
by Phinix (Acolyte) on Dec 11, 2012 at 00:08 UTC

    Fixed it... Just wish I knew how. In my program I had to remove the line "$scrollpane = $scrollpane->Subwidget('scrolled');", after which it works as intended. If anyone can tell me why I would sure appreciate it!

    EDIT: Probably something to do with my scrolled frame being several levels embedded and also on a Notebook tab. Just a note, removing that line will prevent sub-windows within your main scrolled Pane scrolling on their own. There is probably a work-around to get both working but for now this does what I need.

    Thanks!
      You're talking to yourself there Phinix, seriously :)
Re^2: Help with Scrolled Pane mouse wheel binds
by zentara (Archbishop) on Dec 11, 2012 at 10:48 UTC
    Just wish I knew how. In my program I had to remove the line "$scrollpane = $scrollpane->Subwidget('scrolled');",

    That error probably comes from the line

    $scrollpane = $scrollpane->Subwidget('scrolled');
    You can't have $scrollpane in both variable positions. You would use
    my $real_pane = $scrollpane->Subwidget('scrolled');
    but that didn't work for me either. I also suspect it has something to do with you using nested frames with the ScrolledPane. My first guess as to why, is possibly the expand and fill options of the frames. I'm not that familiar with the Form manager.

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1008191]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2014-12-27 19:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls