Logo Search packages:      
Sourcecode: ygraph version File versions  Download package

gboolean current_time_set ( GtkEditable *  time_entry,
gpointer  data 
)

Set the frame time.

Set the current frame time based on updated contents of the "time" input field. The data frames whose times are closest to the requested times are displayed.

Parameters:
time_entry The time entry field widget.
data Data attached to the event (unused).
Returns:
TRUE if successful, otherwise something else.

Definition at line 775 of file callbacks.c.

References all_windows_draw(), current_frame_set(), current_time_display_value(), global_display_mode, global_time_list, and PAUSE_MODE.

Referenced by create_control_panel().

{
  gchar* time_str;
  gdouble requested_time;
  gdouble available_time;
  guint frame_nbr;
  
  UNUSED(data);
  if (global_time_list == NULL) 
    return TRUE;

  time_str = gtk_editable_get_chars(GTK_EDITABLE(time_entry), 0, -1);

  frame_nbr = 0;

  requested_time = g_strtod(time_str, NULL);
  if (!requested_time)
      return TRUE;

  available_time = g_array_index(global_time_list, gdouble, frame_nbr);
  while ((available_time < requested_time) && 
         (frame_nbr < global_time_list->len))
    {
      ++frame_nbr;
      available_time = g_array_index(global_time_list, gdouble, frame_nbr);
    }
  
  if (frame_nbr == global_time_list->len)
    --frame_nbr;

  global_display_mode = PAUSE_MODE;

  current_frame_set(frame_nbr);
  current_time_display_value();

  all_windows_draw();

  return TRUE;
}


Generated by  Doxygen 1.6.0   Back to index