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

gboolean pause_play_button_click ( GtkWidget *  play_button,
GdkEventExpose *  event,
gpointer *  data 
)

Switch the display mode based on "play" button clicks.

Parameters:
play_button The play button widget.
event The calling event.
data Data attached to the event (unused).
Returns:
TRUE if successful, otherwise something else.

Definition at line 529 of file callbacks.c.

References ANIMATE_MODE, frame_draw_next(), global_control_panel, global_current_frame, global_display_mode, global_last_frame, option_animate_delay, PAUSE_MODE, _ControlPanel::play_button, and SHOW_ALL_MODE.

Referenced by create_control_panel(), and plot_window_key_press_event().

{
  UNUSED(event);
  UNUSED(data);
  if (global_display_mode == ANIMATE_MODE)
    {
      global_display_mode = PAUSE_MODE;
      if (global_control_panel != NULL)
        gtk_object_set(GTK_OBJECT(global_control_panel->play_button),
                       "GtkButton::label", (gchar*) PLAY_BUTTON_LABEL, NULL);
      return TRUE;
    }

  if (global_control_panel != NULL)
    gtk_object_set(GTK_OBJECT(global_control_panel->play_button),
                   "GtkButton::label", (gchar*) PAUSE_BUTTON_LABEL, NULL);
  
  if ((global_display_mode == SHOW_ALL_MODE) ||
      (global_current_frame == global_last_frame))
    global_current_frame = FIRST_FRAME-1;

  global_display_mode = ANIMATE_MODE;

  gtk_timeout_add (option_animate_delay, (GtkFunction) frame_draw_next,
                   play_button);

  return TRUE;
}


Generated by  Doxygen 1.6.0   Back to index