This part response to Re^2: Query the height of Tk::Text widget with word wrap
Well, click once, resize window so there is wrapping, click again, compare the numbers
dlineinfo/bbox apparently mostly works for stuff that is visible , that isn't scrolled out of the view
Wow, that's written in a complicated way.
Sure its not :D subs are the fundamental units of code, the essence of good programming, they are testable, if used with argument passing they provide scoping, argument passing eliminates circular references and leaks with closures ... why is my-Tk-prog taking so much memory? It isn't, oh thank you mr non-circular-non-leaky:)
sub foo { my( $mw, $t ) ... } sub bar { my( $mw, $t ) ... } sub Main { GoTk(...); GoTk(...); } sub GoTk { ... [\&foo, $mw, $t] ... [\&bar, $mw, $t] ... MainLoop }
more on this tk closures people, Re: TK Submenus (Tk::Menu , global variables/ spirit of strict), tk scoping function argument passing, can't share Tk mainwondow between threads
This part response to Re^3: Query the height of Tk::Text widget with word wrap
I still can't get dlineinfo to work.
Remember how I (my program) had a button? Meaning you only (it only) call dlineinfo after MainLoop starts and draws everything on screen?
If the widgets (text ...) aren't drawn, dlineinfo can't return coordinates ... so if you want it to work in this program you need to draw the widget, you need $tw->update; before dlineinfo stuff
I used $tw->update; print "now its drawn, now it will be visible\n"; sleep 1;
The window can be located off-the-monitor while the initial drawing takes place :) $mw->geometry('-1000-1000');
In reply to Re^4: Query the height of Tk::Text widget with word wrap
by Anonymous Monk
in thread Query the height of Tk::Text widget with word wrap
by elef
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |