git-svn-id: http://ltt.polymtl.ca/svn@234 04897980-b3bd-0310-b5e0-8ef037075253
authoryangxx <yangxx@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 11 Sep 2003 18:14:25 +0000 (18:14 +0000)
committeryangxx <yangxx@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 11 Sep 2003 18:14:25 +0000 (18:14 +0000)
ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c
ltt/branches/poly/lttv/modules/guiEvents.c

index 53a2770fe43f2fbca4a0b8c3174bb297adda6329..b766fb0800ab0464755f701bba48b7bed69bb39e 100644 (file)
@@ -85,12 +85,15 @@ void insertView(GtkWidget* widget, view_constructor constructor)
 {
   GtkCustom * custom;
   mainWindow * mwData;  
+  GtkWidget * viewer;
 
   mwData = get_window_data_struct(widget);
   if(!mwData->CurrentTab) return;
   custom = mwData->CurrentTab->custom;
 
-  gtk_custom_widget_add(custom, (GtkWidget*)constructor(mwData));  
+  viewer = (GtkWidget*)constructor(mwData);
+  if(viewer)
+    gtk_custom_widget_add(custom, viewer);  
 }
 
 void get_label_string (GtkWidget * text, gchar * label) 
index 27230d11e0c4c5c6f80eeb7b472929242c45c250..89c36e5444f6eb87c7a51f4ba32a54c0a0b505cf 100644 (file)
@@ -230,7 +230,9 @@ hGuiEvents(mainWindow * pmParentWindow)
 {
   EventViewerData* Event_Viewer_Data = GuiEvents(pmParentWindow) ;
 
-  return Event_Viewer_Data->HBox_V ;
+  if(Event_Viewer_Data)
+    return Event_Viewer_Data->HBox_V ;
+  else return NULL;
        
 }
 
@@ -424,6 +426,8 @@ GuiEvents(mainWindow *pmParentWindow)
   Event_Viewer_Data->raw_trace_data = Event_Viewer_Data->raw_trace_data_first;
   get_events(Event_Viewer_Data, start,end, RESERVE_SIZE);
   Event_Viewer_Data->Number_Of_Events = Event_Viewer_Data->raw_trace_data->len;
+
+  if(Event_Viewer_Data->raw_trace_data->len == 0) return NULL;
   
   time_period = g_new(TimePeriod, 1);
   data = g_ptr_array_index(Event_Viewer_Data->raw_trace_data,0);
This page took 0.02729 seconds and 4 git commands to generate.