Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
For 2021 - online Python 3 training - see ((here)).

Our plans were to retire in summer 2020 and see the world, but Coronavirus has lead us into a lot of lockdown programming in Python 3 and PHP 7.
We can now offer tailored online training - small groups, real tutors - works really well for groups of 4 to 14 delegates. Anywhere in the world; course language English.

Please ask about private 'maintenance' training for Python 2, Tcl, Perl, PHP, Lua, etc.
Tk locks up - 100% c.p.u. on a simple program (Tcl, Perl, Python)

Fighting packs and grids - Tk under Tcl, Perl, Python

You'll use pack OR grid to place components into your frame in a Tcl/Tk application. You may use both pack and grid within the same program, but NOT within the same frame. If you do, not only will you be writing code that has no clear meaning, but you'll also invoke the pack and grid handlers at the same time and may cause them to fight. Have a look at this code:

button .ouch -text "do NOT press this button" -command exit
label .more -text "This is a label"
 
button .wow -text "This is a button you may press" -command exit
label .contd -text "Another BORING! label"
 
grid .more .ouch
pack .ouch .more
pack .contd .wow
grid .wow .contd


When I ran that, my prompt was lost, no wish window appeared, and my c.p.u. utilisation rocketed to 99% ... and stayed there. I guess when you have two individuals fighting, they don't show any regard at all for others around them.

Footnote I've often contended that the way to get a user to select a button is to label it "Do not push this under any circumstances" ... which is what I have put in the example above. Some may say that I have a warped sense of humour, or that I have watched too much "Trigger Happy TV".
(written 2007-09-09, updated 2007-09-11)

 
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
Y205 - Further uses of Python
  [190] Python engines - (2005-01-26)
  [595] Add a friendly front end with Tk - (2006-02-08)
  [745] Python modules. The distribution, The Cheese Shop and the Vaults of Parnassus. - (2006-06-05)
  [1036] Python Qt, wX, TkInter, and Jython - training?? - (2007-01-16)
  [1663] Python in an afternoon - a lecture for experienced programmers - (2008-06-01)

T218 - Tcl/Tk - Geometry Managers
  [212] Tcl/Tk (wish) Grid layout example - (2005-02-12)
  [445] Sticky news - (2005-09-15)
  [787] Tk - laying out your GUI with frames, pack and grid - (2006-06-30)
  [1335] Expanding a grid - Tcl/Tk - (2007-09-07)
  [1470] fill and expand on Tcl/Tk pack command - (2007-12-13)

P307 - Perl/Tk
  [596] The magic of -textvariable - (2006-02-08)
  [599] Perl/Tk real time display - (2006-02-10)
  [738] (Perl) Callbacks - what are they? - (2006-05-30)
  [1310] Callbacks - a more complex code sandwich - (2007-08-19)
  [3009] Expect in Perl - a short explanation and a practical example - (2010-10-22)


Back to
Packages and Namespaces are like Suitcases and Aircraft
Previous and next
or
Horse's mouth home
Forward to
Moving to Melksham? Househunting map.
Some other Articles
Catching up on indexing our resources
Melksham Laundrette
Google, wwmdirectory, Freshwater, ATP - new scam?
Moving to Melksham? Househunting map.
Tk locks up - 100% c.p.u. on a simple program (Tcl, Perl, Python)
Packages and Namespaces are like Suitcases and Aircraft
Handling Binary data in Tcl (with a note on C)
A series of tyre damages
Ignore case in Regular Expression
4759 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2021: 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/1340_Tk- ... thon-.html • PAGE BUILT: Sun Oct 11 16:07:41 2020 • BUILD SYSTEM: JelliaJamb