Update Game List after tag selection changed
[xboard.git] / winboard / wgamelist.c
index feda2ca..e31f184 100644 (file)
@@ -48,16 +48,8 @@ static BOOLEAN gameListUp = FALSE;
 static FILE* gameFile;\r
 static char* gameFileName = NULL;\r
 \r
-struct GameListStats\r
-{\r
-    int white_wins;\r
-    int black_wins;\r
-    int drawn;\r
-    int unfinished;\r
-};\r
-\r
 /* [AS] Setup the game list according to the specified filter */\r
-static int GameListToListBox( HWND hDlg, BOOL boReset, char * pszFilter, struct GameListStats * stats, BOOL byPos, BOOL narrow )\r
+int GameListToListBox( HWND hDlg, BOOL boReset, char * pszFilter, struct GameListStats * stats, BOOL byPos, BOOL narrow )\r
 {\r
     ListGame * lg = (ListGame *) gameList.head;\r
     int nItem;\r
@@ -66,6 +58,9 @@ static int GameListToListBox( HWND hDlg, BOOL boReset, char * pszFilter, struct
     int count = 0;\r
     struct GameListStats dummy;\r
 \r
+    if(!hDlg) hDlg = gameListDialog; // [HGM] to allow calling from Game List Options dialog\r
+    if(!hDlg) return 0;\r
+\r
     /* Initialize stats (use a dummy variable if caller not interested in them) */\r
     if( stats == NULL ) {\r
         stats = &dummy;\r