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

Re: GtkDialog issues



Hi,
omar crea jusan it wrote:
> Hi everybody.
> I want to use a GtkDialog to show a message in my application when the user
> clicks a particular button; I tried to implement this dialog in the program,
> but it appears only when the action is finished, and not when it begins.
> I insert here a snippet of the source code:
> 
> /* dialog created in the main function */
> 
>    appdata->dialog = gtk_dialog_new_with_buttons(NULL,
>                   GTK_WINDOW(appdata->window),
>                   GTK_DIALOG_NO_SEPARATOR && GTK_DIALOG_DESTROY_WITH_PARENT,
>                   NULL);
>    appdata->dialogLabel = gtk_label_new("");
>    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(appdata->dialog)->vbox),
> appdata->dialogLabel, TRUE, TRUE, 0);
> 
> 
> /* dialog showed in the open_camera function (associated to the button) */
> 
>    gtk_label_set_text(GTK_LABEL(appdata->dialogLabel), "Opening camera...");
>    gtk_widget_show_all(appdata->dialog);
>    start_pipeline(appdata);
>    add_camera_tab(appdata);
>    gtk_widget_hide_all(appdata->dialog);
> 
gtk does not get cycles to actually bring it up earlier. if you want to hide the
dialog when processing is done start the dialog with gtk_dialog_run and the
processing from e.g. an idle-handeler. Do the gtk_widget_hide_all when
processing is done.

Stefan

> I want the dialog to be showed before the start_pipeline() is called, but it
> appears for a samll time only after the add_camera_tab() is finished, then it
> is hidden.
> I don't know how to accomplish my task (I'm really really new to the dialog
> widget :-) ).
> Thanks in advance. Omar
> 
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



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