From 8b4ca720369d790ea330bc2189efa05cc557c2f7 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Sat, 26 Apr 2014 03:27:19 +0200 Subject: Added gwinListEnableRender() --- demos/modules/gwin/list/main.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'demos') diff --git a/demos/modules/gwin/list/main.c b/demos/modules/gwin/list/main.c index 36820c23..3811c36f 100644 --- a/demos/modules/gwin/list/main.c +++ b/demos/modules/gwin/list/main.c @@ -52,10 +52,6 @@ static void createWidgets(void) { wi.text = "List 2: Smooth scrolling"; ghLabel1 = gwinLabelCreate(NULL, &wi); - // Make list widgets invisible by default as they would issue - // a re-render at every time an item is added - wi.g.show = FALSE; - // The first list widget wi.g.width = 150; wi.g.height = 100; @@ -112,6 +108,9 @@ int main(void) { gwinListAddItem(ghList1, "Item 13", FALSE); // Add some items to the second list widget + // This time we will disable the render until + // all the items have been added + gwinListEnableRender(ghList2, FALSE); gwinListAddItem(ghList2, "Item 0", FALSE); gwinListAddItem(ghList2, "Item 1", FALSE); gwinListAddItem(ghList2, "Item 2", FALSE); @@ -126,10 +125,7 @@ int main(void) { gwinListAddItem(ghList2, "Item 11", FALSE); gwinListAddItem(ghList2, "Item 12", FALSE); gwinListAddItem(ghList2, "Item 13", FALSE); - - // Make all the lists visible - gwinSetVisible(ghList1, TRUE); - gwinSetVisible(ghList2, TRUE); + gwinListEnableRender(ghList2, TRUE); while(1) { // Get an Event -- cgit v1.2.3