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

void image_dir_export_dialog ( Plot plot,
gint  action,
GtkItem *  export_button 
)

Create a dialog box for exporting a series of images to a directory.

Parameters:
plot The Plot to be exported.
action The calling action.
export_button The calling button.
Returns:
TRUE if successful, otherwise crash.

Definition at line 1060 of file callbacks.c.

References export_dir_set(), and image_export_file_select().

{
  GtkWidget* dialog;
  GtkWidget* label;
  GtkWidget* hbox_A;
  GtkWidget* file_label_A;
  GtkWidget* file_button_A;
  GtkWidget* okay_button;
  GtkWidget* cancel_button;

  UNUSED(action);
  UNUSED(export_button);
  dialog = gtk_dialog_new();
  gtk_window_set_title(GTK_WINDOW(dialog), EXPORT_TO_DIR_TITLE);
  gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, FALSE, TRUE);

  label = gtk_label_new(EXPORT_DIR_SELECT_MESSAGE);
  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), label);

  hbox_A = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox_A);
  gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox_A, FALSE,
                     FALSE, 0);

  file_label_A = gtk_label_new(EXPORT_DIR_LABEL);
  gtk_widget_show(file_label_A);
  gtk_box_pack_start(GTK_BOX(hbox_A), file_label_A, FALSE, FALSE, 0);

  file_entry_A = gtk_entry_new();
  gtk_entry_set_max_length(GTK_ENTRY(file_entry_A), FILE_STR_SIZE);
  gtk_entry_set_text(GTK_ENTRY(file_entry_A), "");

  gtk_widget_show(file_entry_A);
  gtk_box_pack_start(GTK_BOX(hbox_A), file_entry_A, FALSE, FALSE, 0);
  gtk_widget_set_usize(file_entry_A, FILE_ENTRY_LENGTH, -2);
  gtk_signal_connect(GTK_OBJECT(file_entry_A), "activate",
                     GTK_SIGNAL_FUNC(export_dir_set), plot);
  gtk_signal_connect_object(GTK_OBJECT(file_entry_A), "activate",
                            GTK_SIGNAL_FUNC (gtk_widget_destroy),
                            GTK_OBJECT(dialog));


  file_button_A = gtk_button_new_with_label(SELECT_LABEL);
  gtk_signal_connect(GTK_OBJECT(file_button_A), "clicked",
                     GTK_SIGNAL_FUNC(image_export_file_select), plot);
  gtk_widget_show(file_button_A);
  gtk_box_pack_start(GTK_BOX(hbox_A), file_button_A, FALSE, FALSE, 0);

  okay_button = gtk_button_new_with_label(OKAY_BUTTON_LABEL);
  gtk_signal_connect(GTK_OBJECT(okay_button),
                     "clicked", GTK_SIGNAL_FUNC(export_dir_set), plot);
  gtk_signal_connect_object (GTK_OBJECT (okay_button), "clicked",
                             GTK_SIGNAL_FUNC (gtk_widget_destroy),
                             GTK_OBJECT(dialog));
  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->action_area),
                     okay_button);
  gtk_widget_show(okay_button);

  cancel_button = gtk_button_new_with_label(CANCEL_BUTTON_LABEL);
  gtk_signal_connect_object (GTK_OBJECT (cancel_button), "clicked",
                             GTK_SIGNAL_FUNC (gtk_widget_destroy),
                             GTK_OBJECT(dialog));
  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->action_area),
                     cancel_button);
  gtk_widget_show(cancel_button);

  gtk_widget_show_all (dialog);
}


Generated by  Doxygen 1.6.0   Back to index