GtkDialog problems again



Hi everybody.
I need a dialog in my application that simply show a label (so without any
button) and then hide itself after some processing occurred.
The problem is that I can't send any :response signal to the dialog, so it
remains blocked in the loop after gtk_dialog_run has been called.
I tried to use the example posted in the GTK+ reference manual, but without
success.


Here is the code snippet:

appdata->dialogLabel = gtk_label_new(NULL);
    gtk_label_set_text(GTK_LABEL(appdata->dialogLabel),
          "Opening camera...");

    appdata->dialog = gtk_dialog_new_with_buttons("Open Camera",
          GTK_WINDOW(appdata->window),
          GTK_DIALOG_NO_SEPARATOR | GTK_DIALOG_DESTROY_WITH_PARENT,
          NULL);
    gtk_container_add(GTK_CONTAINER(GTK_DIALOG(appdata->dialog)->vbox),
appdata->dialogLabel);

    gtk_widget_show_all(appdata->dialog);
    // program stops here
    gint result = gtk_dialog_run(GTK_DIALOG(appdata->dialog));
    switch (result) {
       case GTK_RESPONSE_ACCEPT:
          gtk_widget_hide_all(appdata->dialog);
          break;
       default:
          gtk_dialog_response(GTK_DIALOG(appdata->dialog),
GTK_RESPONSE_DELETE_EVENT);
          start_pipeline(appdata);
          add_camera_tab(appdata);
          break;
    }
    gtk_widget_destroy(appdata->dialog);

....


I need that the dialog hides itself after start_pipeline() and add_camera_tab()
is called.
Thanks in advance.

Omar

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]