From: Russell O. <ro...@uw...> - 2014-12-17 17:33:03
|
On 12/5/14 4:54 PM, Russell Owen wrote: > I have a log window consisting of a Text widget, scroll bar, and various > widgets to control the display. Some of of the control widgets are > usually hidden, using grid.remove() to remove the parent frame of the > widgets. > > With Tcl/Tk 8.5.17 on MacOS we see the hidden widgets briefly appear > whenever the main frame for this window receives an <Expose> event. > Unfortunately such an event occurs whenever a new item is appended to > the log (I'm not sure why). New lines can come in quite often, leading > to an annoying flicker of the hidden widgets.... I was able to generate a simple demo script (below) and have posted a bug report <http://core.tcl.tk/tk/tktview/7a325ad72cbb6e331fbae3f4116fe112bda698f4>. My description was a bit wrong: it's not <Expose> events that cause the flicker, but something else that occurs at the same time as the <Expose> event (I have not figured out what). Also, menubuttons flicker but a few other widgets I've tried do not. Michiel de Hoon reports seeing the problem in Tcl/Tk 8.6.3. I would really appreciate it if somebody could try this on linux (I don't have access to a linux with a new enough Tcl/Tk). That would support or disprove Kevin Walzer's theory that this is caused by removing the private Cocoa API calls from Tk. If Keven is right then we'll likely have to live with it. If it shows up on linux as well then it's more likely worth trying to fix. Regards, -- Russell #!/usr/bin/env wish # A simple test case to show flicker of a hidden widget. # # I see the flicker on MacOS 10.9 using Tcl/Tk 8.5.17, but not some older versions of Tcl/Tk I have tried. # # To see the flicker: # - Run the script # - Push the "Hide Wdg" button # - Resize the widget, preferably in width; the hidden widget will be shown while resizing # # Variations: # - I first saw the problem with a window that contained a scrolled Text widget (a log window). Every time text was added to the Text widget the hidden widget flickered. # - I've used grid_forget and still see the flicker. # - I've tried making hidden widget a Label or an Entry instead of a MenuButton and I do NOT see the flicker. wm geometry . "200x50" menubutton .wdg -text "Wdg" grid .wdg -row 0 -column 1 button .btn -text "Hide Wdg" -command {grid remove .wdg} grid .btn -row 0 -column 0 |