Tankbuster Posted December 19, 2013 Share Posted December 19, 2013 Hello, could someone explain why the control $labelOnTab2 in the example below flickers when the mouse is moved? As soon as the control is updated it starts to flicker (at least on two systems) I re-used the example and modified it to demonstrate. I hope you could see the effect. To reproduce: Start script. move mouse / expect: nothing will flicker wait at least one minute until $labelOnTab2 is once updated move mouse / expect: control will flicker change tab now also "label1" and "label0" (using the same coordinates) will flicker. Is this a problem of the while loop catching the $msg? expandcollapse popup#include <GUIConstantsEx.au3> Example() Func Example() Local $msg GUICreate("My GUI Tab") ; will create a dialog box that when displayed is centered GUISetBkColor(0x00E0FFFF) GUISetFont(9, 300) GUICtrlCreateTab(10, 10, 200, 100) GUICtrlCreateTabItem("tab0") GUICtrlCreateLabel("label0", 30, 80, 50, 20) GUICtrlCreateButton("OK0", 20, 50, 50, 20) GUICtrlCreateInput("default", 80, 50, 70, 20) GUICtrlCreateTabItem("tab----1") GUICtrlCreateLabel("label1", 30, 80, 50, 20) GUICtrlCreateCombo("", 20, 50, 60, 120) GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon") ; default Jon GUICtrlCreateButton("OK1", 80, 50, 50, 20) GUICtrlCreateTabItem("tab2") GUICtrlSetState(-1, $GUI_SHOW) ; will be display first $labelOnTab2=GUICtrlCreateLabel(@MIN, 30, 80, 50, 20) GUICtrlCreateButton("OK2", 140, 50, 50) GUICtrlCreateTabItem("") ; end tabitem definition GUICtrlCreateLabel("label3", 20, 130, 50, 20) GUISetState() $lastSec=@MIN ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop ConsoleWrite(@MIN&":"&$lastSec&@LF) if $lastSec <> @MIN Then guictrlsetdata($labelOnTab2,@MIN) EndIf WEnd EndFunc ;==>Example Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 19, 2013 Moderators Share Posted December 19, 2013 Tankbuster,You need to reset the $lastSec variable to match the new content of the label or else the comparison fires on every pass through the loop after the first update: If $lastSec <> @MIN Then GUICtrlSetData($labelOnTab2, @MIN) $lastSec = @MIN ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< EndIfThe other labels flickered because they share the same location and the entire GUI is rewritten when there is a change to one of the controls. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Tankbuster Posted December 19, 2013 Author Share Posted December 19, 2013 (edited) Oh, yes the forgotten set of the $lastsec I missed in my example (in my real app it was there, sorry... - I'm a ) And now it works. But one question that was actually the root cause of the post: If on Windows 7 the style is set to "Windows basic" (no aero) it is flickering. Same script on Aero Style DOES NOT flicker, but I guess the answer "..entire GUI is rewritten..." is differently handled by windows in these two styles, right? expandcollapse popup#include <GUIConstantsEx.au3> Example() Func Example() Local $msg GUICreate("My GUI Tab") ; will create a dialog box that when displayed is centered GUISetBkColor(0x00E0FFFF) GUISetFont(9, 300) GUICtrlCreateTab(10, 10, 200, 100) GUICtrlCreateTabItem("tab0") GUICtrlCreateLabel("label0", 30, 80, 50, 20) GUICtrlCreateButton("OK0", 20, 50, 50, 20) GUICtrlCreateInput("default", 80, 50, 70, 20) GUICtrlCreateTabItem("tab----1") GUICtrlCreateLabel("label1", 30, 80, 50, 20) GUICtrlCreateCombo("", 20, 50, 60, 120) GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon") ; default Jon GUICtrlCreateButton("OK1", 80, 50, 50, 20) GUICtrlCreateTabItem("tab2") GUICtrlSetState(-1, $GUI_SHOW) ; will be display first $labelOnTab2=GUICtrlCreateLabel(@SEC, 30, 80, 50, 20) GUICtrlCreateButton("OK2", 140, 50, 50) GUICtrlCreateTabItem("") ; end tabitem definition GUICtrlCreateLabel("label3", 20, 130, 50, 20) GUISetState() $lastSec=@SEC ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop ConsoleWrite(@SEC&":"&$lastSec&@LF) if $lastSec <> @SEC Then $lastsec = @SEC guictrlsetdata($labelOnTab2,$lastsec) EndIf WEnd EndFunc ;==>Example Modified script (with seconds now) To reproduce: set win7 to AERO (default windows) start script change tab to "tab0" / expecting text "label0" is not flickering stop script set Win7 to Windows basic (no aero) start script change tab to "tab0" / expecting text "label0" is flickering from time to time (not every update...) Does this makes sense? Only the control that shares the location on the screen with the updated control in a second tab is flickering when the simple windows style is used... Edited December 19, 2013 by Tankbuster Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 19, 2013 Moderators Share Posted December 19, 2013 (edited) Tankbuster,I do not run Win7 so I cannot comment, sorry. M23Edit: I misled you earlier. It is not the whole GUI that is redrawn, it is just the area of screen affected by the control being updated - but the rewriting of that control flickers that area on the screen so any other controls in the same place (on another tab for example) will also flicker as that area is rewritten. Edited December 19, 2013 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Tankbuster Posted December 19, 2013 Author Share Posted December 19, 2013 Ok, this makes sense. Because as I wrote the flickering affects only the area of the changed text. btw: My solution was to move the updating control to a area that is not shared with other tabs. I just wanted to knwo if others do also see this behavior or if this is limited to certain configs/windows and so on. Thx for trying. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now