Sign in to follow this  
Followers 0
Naufuge

Refreshing a ListView

6 posts in this topic

My script uses a list view that you are able to add, and delete items from. The items are saved in a text file, which is "#included" after creating the listview. my Main Loop calls two functions to update the lists. but when it is running there is a Massive Flicker. How can i stop this?

My loop is:

While 1
    Update_SettingList()
    Update_LogList()
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE Or $msg = $File_Exit
        FileDelete(@ScriptDir & "\Configuration Files\Temp_Log.dbl")
        FileWrite(@ScriptDir & "\Configuration Files\Temp_Log.dbl","")
        ExitLoop
...  ...  ...  ...  ...  ...   ...  ...  ...  ...  ...  ...   ...  ...  ...  ...  ...  ...   ...  ...  ...  ...  ...  ...   ...  ...  ...  ...  ...  ...

My Function for updating is:

Func Update_SettingList()
    GuiCtrlDelete($Setting_List)
    $Setting_List = GUICtrlCreateListView("Setting Name|Status|Location|Runs|Failed|Total Time|Ping|Restarts", 0,0,740,155)
        #include <Configuration Files\Settings.dbl>
EndFunc

Share this post


Link to post
Share on other sites



My script uses a list view that you are able to add, and delete items from. The items are saved in a text file, which is "#included" after creating the listview. my Main Loop calls two functions to update the lists. but when it is running there is a Massive Flicker. How can i stop this?

My loop is:

While 1
    Update_SettingList()
    Update_LogList()
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE Or $msg = $File_Exit
        FileDelete(@ScriptDir & "\Configuration Files\Temp_Log.dbl")
        FileWrite(@ScriptDir & "\Configuration Files\Temp_Log.dbl","")
        ExitLoop
...  ...  ...  ...  ...  ...   ...  ...  ...  ...  ...  ...   ...  ...  ...  ...  ...  ...   ...  ...  ...  ...  ...  ...   ...  ...  ...  ...  ...  ...

My Function for updating is:

Func Update_SettingList()
    GuiCtrlDelete($Setting_List)
    $Setting_List = GUICtrlCreateListView("Setting Name|Status|Location|Runs|Failed|Total Time|Ping|Restarts", 0,0,740,155)
        #include <Configuration Files\Settings.dbl>
EndFunc
it looks like you have things in the loop that don't need to be done more than once... that will lead to flickering etc.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

I dont NEED them in the loop, but it would make the app run more efficently if they where...

Share this post


Link to post
Share on other sites

i would suggest setting a flag, $datachanged = 0

if $datachanged then

; do your updates

$datachanged = 0

endif


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

I dont NEED them in the loop, but it would make the app run more efficently if they where...

technically, unnecessary repetition IS inefficiency.... if you post a full script i'll see if i can't optimize it some for ya. (after i work out your signature)

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Hi,

Idon't understand how you are writing the individual listview items..

Are they in the include?

Anyway, are you using; (before and after each recreate/ rewrite of listview)

Func _LockAndWait2()

Local $Cursor_WAIT

GUISetState(@SW_LOCK)

GUISetCursor($Cursor_WAIT, 1)

EndFunc ;==>_LockAndWait2

Func _ResetLockWait2()

Local $Cursor_ARROW

GUISetState(@SW_UNLOCK)

GUISetCursor($Cursor_ARROW, 1)

EndFunc ;==>_ResetLockWait2

to stop flicker?

Randall

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0