MouseSpotter Posted May 19, 2013 Share Posted May 19, 2013 I am adding a large list of data to a combobox dropdown (mainly because I want the list be visible beyond the thin GUI height). The list is then filtered, based on what the user enters in the edit box (a reducing list). Rebuilding the dropdown list is causes the list to 'flicker' because it is cleared then re-shown. _GUICtrlComboBox_BeginUpdate has reduced the flicker a bit - however, I am looking for a way to reduce this further. Any ideas? I have looked into the _GUICtrlComboBox & _GUICtrlComboBoxEx options and these are slower than the GUICtrlSetData options: expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiComboBox.au3> #include <GuiComboBoxEx.au3> Local $hGui = GUICreate("") local $t local $text = "" local $y = 0 $t=TimerInit() local $hCombo_Add = _GUICtrlComboBox_Create($hGui,"",0,$y) $y += 40 for $i=1 to 4500 _GUICtrlComboBox_AddString($hCombo_Add,$i) next ConsoleWrite("_GUICtrlComboBox_AddString:" & TimerDiff($t)&@crlf) $t=TimerInit() $text = "" for $i=1 to 4500 $text &= $i & "|" next local $hCombo_Create = _GUICtrlComboBox_Create($hGui,$text,0,$y) $y += 40 ConsoleWrite("_GUICtrlComboBox_Create:" & TimerDiff($t)&@crlf) $t=TimerInit() local $hComboEx_Add = _GUICtrlComboBoxEx_Create($hGui,"",0,$y) $y += 40 for $i=1 to 4500 _GUICtrlComboBoxEx_AddString($hComboEx_Add,$i) next ConsoleWrite("_GUICtrlComboBoxEx_AddString:" & TimerDiff($t)&@crlf) $t=TimerInit() $text = "" for $i=1 to 4500 $text &= $i & "|" next local $hComboEx_Create = _GUICtrlComboBoxEx_Create($hGui,$text,0,$y) $y += 40 ConsoleWrite("_GUICtrlComboBoxEx_Create:" & TimerDiff($t)&@crlf) $t=TimerInit() $text = "" for $i=1 to 4500 $text &= $i & "|" next GUICtrlCreateCombo("",0,$y) $y += 40 GUICtrlSetData(-1,$text) ConsoleWrite("GUICtrlSetData:"&TimerDiff($t)&@crlf) GUISetState() While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() Link to comment Share on other sites More sharing options...
water Posted May 19, 2013 Share Posted May 19, 2013 Have a look at GUICtrlSetData to update the ComboBox with a single call. _GUI* (UDF) functions are slower than GUI* functions because the UDF functions are implemented in pure AutoIt whereas the GUI* functions are written in C++. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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