Re: pTk Scrolled Text problem

Slaven Rezic <[email protected]>
Newsgroups gmane.comp.lang.perl.tk
Message-ID <[email protected]>
Todd Littlefield <[email protected]> writes:

> My thanks to everyone for all your suggestions...  I'll make the 
> horizontal bar fixed and try an optional vertical bar...
> I can't have the text wrap since it is tabular output from a telnet
> session...
> 
> As Ala said, they may be evil but it gives the UI a nice look.  If you
> don't need them, they don't clutter the UI...  Guess a 50% cluttering
> will have to suffice.
> 
> Should this be a bug opened against the core Tcl/Tk interface if
> that is where the problem lies?

No, it's a Perl/Tk only problem. There is no native Scrolled pseudo
widget in Tcl/Tk.

Vadim: the same problem occurs with Tcl/Tk 8.4.11. I also noticed that
the -scrollbars option is not really implemented, there's only "osoe"
possible (I see the "TODO" in lib/Tcl/Tk.pm).

Regards,
        Slaven

> 
> On Wed, 2005-12-14 at 22:58 +0100, Slaven Rezic wrote:
> > "Konovalov, Vadim" <[email protected]> writes:
> > 
> > > > Here is a script that will show the problem...  When it starts up it
> > > > will consume 100% cpu due to the scrollbar attempting to redraw...
> > > > Watch the thumb bounce up and down in the scroll region.
> > >
> > > this problem is in perl/Tk and does not appear to be in Tcl/Tk.
> > > Because if I replace many "use Tk; use Tk::something" with single
> > >
> > >   use Tcl::Tk qw(:perlTk);
> > >
> > > , the problem does not appear.
> > >
> > > As a side note, following lines in that script are inessential but
> > > incorrect:
> > >
> > > # subroutine declarations, needed by strict setting
> > > use subs qw( CreateMainUI );
> > >
> > > removing those do not influence breakage
> > >
> > 
> > Sorry, same problem with Tcl::Tk 0.88 + Tcl 0.88 on a FreeBSD/XFre86
> > system. I think that the length of the inserted text is crucial for
> > the problem to appear. So if your're on a Windows system, you have to
> > insert different text to make the problem occur.
> > 
> > Interestingly, after a few iterations the Tcl interpreter dies:
> > 
> > too many nested evaluations (infinite loop?)
> >     while executing
> > "place .sc02._grid.vscroll -relwidth 1.0 -relheight 1.0 -in .sc02._grid.vframe -
> > x 1 -y 0 -width -1"
> >     ("eval" body line 1)
> >     invoked from within
> > "eval place $sb $args"
> >     (procedure "ScrolledWindow::_setSBSize" line 3)
> >     invoked from within
> > "ScrolledWindow::_setSBSize .sc02._grid.vscroll 13 -relwidth 1.0 -relheight 1.0 
> > -in .sc02._grid.vframe -x 1 -y 0 -width -1"
> >     (command bound to event)
> > too many nested evaluations (infinite loop?)
> >     while executing
> > "ScrolledWindow::_setSBSize .sc02._grid.vscroll 13 -relwidth 1.0 -relheight 1.0 
> > -in .sc02._grid.vframe -x 1 -y 0 -width -1"
> >     (command bound to event)
> > too many nested evaluations (infinite loop?)
> >     while executing
> > "ScrolledWindow::_set_vscroll .sc02 0 0.454545"
> >     (vertical scrolling command executed by text)
> > too many nested evaluations (infinite loop?)
> >     while executing
> > "ScrolledWindow::_set_hscroll .sc02 0 1"
> >     (horizontal scrolling command executed by text)
> > 
> > I usually avoid using two optional scrollbars because of this problem.
> > Best is to make one of the two fixed, or to set word/character
> > wrapping to on, so there's no need for a horizontal scrollbar.
> > 
> > Regards,
> >         Slaven
> > 
> > --
> > Slaven Rezic - slaven <at> rezic <dot> de
> > 
> >     tksm - Perl/Tk program for searching and replacing in multiple files
> >     http://ptktools.sourceforge.net/#tksm
> -- 
> 
>                                                         - Todd
> 

-- 
Slaven Rezic - slaven <at> rezic <dot> de

Tk-AppMaster: a perl/Tk module launcher designed for handhelds
	http://tk-appmaster.sf.net
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.