Jump to content

Refreshing a ListView


Naufuge
 Share

Recommended Posts

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
Link to comment
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.
Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...