diff options
author | John Ankarström <john@ankarstrom.se> | 2022-04-04 21:56:22 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-04-04 21:56:22 +0200 |
commit | 89cc2518f313afc5da650f327af838fa4e1b79ff (patch) | |
tree | 311895799b562fc6d1aa708c57f349fddbc2e16f /c | |
parent | 95b88391c331a82f6a404c49806954cd7f164d3b (diff) | |
download | EpisodeBrowser-89cc2518f313afc5da650f327af838fa4e1b79ff.tar.gz |
Don't start updating episode list until after window is drawn.
This ensures the window is displayed before the episodes are loaded,
which is important on slow internet connections.
Diffstat (limited to 'c')
-rw-r--r-- | c/episodelistview.c | 5 | ||||
-rw-r--r-- | c/main.c | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/c/episodelistview.c b/c/episodelistview.c index 5909f54..6b00b31 100644 --- a/c/episodelistview.c +++ b/c/episodelistview.c @@ -13,7 +13,6 @@ HWND ElvCreate() { LVCOLUMN lvc; - term_t t; LpLviElvSelection = malloc(sizeof(LVITEM)); if (!LpLviElvSelection) return NULL; @@ -30,10 +29,6 @@ ElvCreate() lvc.cx = 500; ListView_InsertColumn(HElv, 1, &lvc); - t = T(0); - P("track_episodes","update_tracked_episodes",0,t); - ElvUpdate(); - ElvSelectRecent(); return HElv; } @@ -30,9 +30,10 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR tszErr; MSG msg; INITCOMMONCONTROLSEX icc; + term_t t; WNDCLASSEX wc; - /* Set constant globals. */ + /* Set constant values. */ hModule = LoadLibrary(TEXT("uxtheme.dll")); BThemes = hModule && GetProcAddress(hModule,"SetWindowTheme"); if (hModule) FreeLibrary(hModule); @@ -81,6 +82,12 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, if (!hWnd) goto f; ShowWindow(hWnd, nCmdShow); + /* Populate episode list view. */ + t = T(0); + P("track_episodes","update_tracked_episodes",0,t); + ElvUpdate(); + ElvSelectRecent(); + while (GetMessage(&msg, NULL, 0, 0) > 0) { if (IsDialogMessage(hWnd, &msg)) continue; TranslateMessage(&msg); |