Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Adrian Robert <adrian.b.robert@gm...> - 2012-07-20 19:33:37
|
I've tried to fix related issues with adding and removing widgets at the bottom of a window. In that case the Cocoa Tk at first wrongly compensates for the reversal of the y coordinates in Cocoa (y=0 is at the bottom). The window will first increase in height to accomodate the new widget. Then all of the window's contents are redrawn incorrectly, and then finally redrawn again correctly (or sometimes still incorrecly). (See script at end, also attached, and run it with either wish8.5 or wish8.4.) I never figured out if this was a bug in the drawing code, the event loop, or both. Both of these parts of the code are extensive and distributed, and it's hard to trace through the entire process. The best attempt so far is documented at this bug (open the comments section): http://sourceforge.net/tracker/?func=detail&aid=3028676&group_id=12997&atid=112997 Unfortunately, it seems like everyone who ventures into this code, whatever their skills and determination, ends up heading back out vanquished. And a complete rewrite is too big of a task to contemplate. -Adrian #!/usr/bin/wish proc makeList { pw x } { set w "${pw}._$x" listbox $w for { set i 0 } { $i < 10 } { incr i } { $w insert end "Foo $i" } return $w } set state 0 proc swap { } { if { $::state == 0 } { pack .bottom -side top -expand 1 -fill x } else { pack forget .bottom .bottom.foo configure -height 0 } set ::state [expr 1 - $::state] } frame .verytop frame .top frame .mid frame .bottom button .verytop.bu -text "Swap" -command swap foreach p { .top .mid } { for { set i 0 } { $i < 3 } { incr i } { pack [makeList $p $i] -side left } } label .bottom.foo -text "Foo" pack .verytop.bu pack .bottom.foo pack .verytop .top .mid -side top -expand 1 -fill x |