Created tabs at open .tbo
authordanigm <dani@danigm.net>
Thu, 18 Mar 2010 23:27:05 +0000 (23:27 +0000)
committerdanigm <danigm@aa302d1f-72b1-406a-902b-8593ca2b2744>
Thu, 18 Mar 2010 23:27:05 +0000 (23:27 +0000)
From: danigm <dani@danigm.net>

git-svn-id: https://forja.rediris.es/svn/cusl4-tbo@102 aa302d1f-72b1-406a-902b-8593ca2b2744

src/comic.c

index 5661394..eca0c96 100644 (file)
@@ -196,10 +196,24 @@ void
 tbo_comic_open (TboWindow *window, char *filename)
 {
     Comic *newcomic = tbo_comic_load (filename);
 tbo_comic_open (TboWindow *window, char *filename)
 {
     Comic *newcomic = tbo_comic_load (filename);
+    int nth;
     if (newcomic)
     {
         tbo_comic_free (window->comic);
         window->comic = newcomic;
         gtk_window_set_title (GTK_WINDOW (window->window), window->comic->title);
     if (newcomic)
     {
         tbo_comic_free (window->comic);
         window->comic = newcomic;
         gtk_window_set_title (GTK_WINDOW (window->window), window->comic->title);
+
+        for (nth=gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->notebook)); nth>0; nth--)
+        {
+            gtk_notebook_remove_page (GTK_NOTEBOOK (window->notebook), nth);
+        }
+
+        for (nth=1; nth<tbo_comic_len (window->comic); nth++)
+        {
+            gtk_notebook_insert_page (GTK_NOTEBOOK (window->notebook),
+                                      create_darea (window),
+                                      NULL,
+                                      nth);
+        }
     }
 }
     }
 }