state update hooks are added by the main window
authoryangxx <yangxx@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 16 Jan 2004 17:52:49 +0000 (17:52 +0000)
committeryangxx <yangxx@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 16 Jan 2004 17:52:49 +0000 (17:52 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@388 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c
ltt/branches/poly/lttv/modules/gui/mainWin/src/init_module.c
ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.c
ltt/branches/poly/lttv/modules/guiStatistic/guiStatistic.c

index 5440d6ecbfd2bad288adac29662dfc04388b9cbd..6abfd51cb6863ee9ea7f0f64fd8293696e4f270f 100644 (file)
@@ -323,9 +323,6 @@ void redraw_viewer(MainWindow * mw_data, TimeWindow * time_window)
   gdk_window_stick(win);
   gdk_window_unstick(win);
  
-  //lttv_state_add_event_hooks(
-  //           (LttvTracesetState*)mw_data->current_tab->traceset_info->traceset_context);
-
   //update time window of each viewer, let viewer insert hooks needed by process_traceset
   set_time_window(mw_data, time_window);
   
@@ -335,9 +332,6 @@ void redraw_viewer(MainWindow * mw_data, TimeWindow * time_window)
                       ltt_time_add(time_window->start_time,time_window->time_width),
                       max_nb_events);
 
-  //lttv_state_remove_event_hooks(
-  //        (LttvTracesetState*)mw_data->current_tab->traceset_info->traceset_context);
-
   //call hooks to show each viewer and let them remove hooks
   show_viewer(mw_data);  
 
@@ -1726,6 +1720,9 @@ void * create_tab(MainWindow * parent, MainWindow* current_window,
            "Tab_Info",
           tmp_tab,
           (GDestroyNotify)tab_destructor);
+
+  lttv_state_add_event_hooks(
+       (LttvTracesetState*)tmp_tab->traceset_info->traceset_context);
   
   gtk_notebook_append_page(notebook, (GtkWidget*)tmp_tab->multi_vpaned, tmp_tab->label);  
   list = gtk_container_get_children(GTK_CONTAINER(notebook));
index 7bf2f5e37f0399319f0690f4d637ae27f57b62de..2201eadc1f6d5167055fab578fdebcb5a2d4783b 100644 (file)
@@ -113,6 +113,11 @@ void
 main_window_free(MainWindow * mw)
 { 
   if(mw){
+    while(mw->tab){
+      lttv_state_remove_event_hooks(
+           (LttvTracesetState*)mw->tab->traceset_info->traceset_context);
+      mw->tab = mw->tab->next;
+    }
     g_object_unref(mw->attributes);
     g_main_window_list = g_slist_remove(g_main_window_list, mw);
 
index 71fc6e542d7d43a2f61852fde4cd0244a69c282d..0d666ceefa6bc6b1900a0a651ed802f7acea1b2d 100644 (file)
@@ -110,7 +110,8 @@ void drawing_data_request(Drawing_t *Drawing,
        LttvHooks *after_traceset = lttv_hooks_new();
        lttv_hooks_add(after_traceset, after_data_request, &event_request);
        lttv_hooks_add(event, draw_event_hook, &event_request);
-       state_add_event_hooks_api(control_flow_data->Parent_Window);
+       //Modified by xiangxiu: state update hooks are added by the main window
+       //state_add_event_hooks_api(control_flow_data->Parent_Window);
        lttv_hooks_add(after_event, draw_after_hook, &event_request);
 
        lttv_process_traceset_seek_time(tsc, start);
@@ -126,7 +127,8 @@ void drawing_data_request(Drawing_t *Drawing,
                        //NULL, after_traceset, NULL, NULL, NULL, NULL,
                        NULL, NULL, NULL, NULL, NULL, NULL,
                        NULL, after_traceset, NULL, event, after_event);
-       state_remove_event_hooks_api(control_flow_data->Parent_Window);
+       //Modified by xiangxiu: state update hooks are removed by the main window
+       //state_remove_event_hooks_api(control_flow_data->Parent_Window);
 
        lttv_hooks_destroy(after_traceset);
        lttv_hooks_destroy(event);
index 9b1305721b3e84b6119b29fd53fc1abb9e225303..c7ed6e6dc42494deb780af974430d17b613bd3bb 100644 (file)
@@ -628,7 +628,7 @@ void statistic_add_context_hooks(StatisticViewerData * statistic_viewer_data,
   }  
 
   //add state and stats hooks
-  state_add_event_hooks_api(statistic_viewer_data->mw);  //it will be added in the main window
+  //state_add_event_hooks_api(statistic_viewer_data->mw);  //it will be added in the main window
   stats_add_event_hooks_api(statistic_viewer_data->mw);
   
 }
@@ -680,7 +680,7 @@ void statistic_remove_context_hooks(StatisticViewerData * statistic_viewer_data,
   }
 
   //remove state and stats hooks
-  state_remove_event_hooks_api(statistic_viewer_data->mw); //it will be done in the main window
+  //state_remove_event_hooks_api(statistic_viewer_data->mw); //it will be done in the main window
   stats_remove_event_hooks_api(statistic_viewer_data->mw);
 }
 
This page took 0.028458 seconds and 4 git commands to generate.