How to Disable Redrawing of a Control

Warning! Some information on this page is older than 3 years now. I keep it for reference, but it probably doesn't reflect my current knowledge and beliefs.

18:43
Thu
18
Mar 2010

How to Disable Redrawing of a Control

When coding Windows application with GUI, there is an issue about how long does it take to add lots of items (like hundreds or thousands) into a list view or tree view control. It is caused by redrawing the control after each operation. I've seen this annoying effect in may programs, including some serious, commercial ones. Apparently many programmers don't know there is a simple solution. But first a bit of background...

When coding games, we constantly spin inside a big loop and redraw whole screen every frame. Calculations are separated from rendering so we can, for example, build a list with thousands of items in the computation function and the visible part of the list will start being rendered since the first rendering function call after that. When coding windowed applications, nothing new is drawn onto the screen unless needed. We have to manually do it and we can call redrawing function any time. So how should a list control be refreshed when we add an item into it? It is done automatically after each insert, which is a good solution... unless we want to add hundreds of them.

So GUI library developers provide a functionality to temporarily disable redrawing of a control.

Comments (1) | Tags: .net mfc wxwidgets winapi gui | Author: Adam Sawicki | Share

Comments

miga
2015-11-30 10:43:05
Un lloc web reeixit - una combinació de diversos factors, incloent: planificació de la qualitat, la facilitat de navegació, la informació disponible, el disseny visual. Combinació crítica de coneixements que inclou la concepció creativa i habilitats tècniques i interactius i disseny li permetrà mantenir el seu lloc web amb eficàcia. http://saitv.3dn.ru/ tecnologia d'Internet no es queda quiet, el canvi dels motors de recerca de feina, la millora del mètode dels llocs de mostreig en els resultats de cerca. Seguim les innovacions i estem disposats a donar assessorament gratuït sobre el desenvolupament i la millora del seu lloc.

Post comment

Nick *
Your name or nickname
E-mail
Your contact information (optional, will not be shown)
Text *
Content of your comment
Calculate *
(* - required field)
STAT NO AD [Stat] [Admin] [STAT NO AD] [pub] [Mirror] Copyright © 2004-2017 Adam Sawicki
Copyright © 2004-2017 Adam Sawicki