gtk_dialog_run () problem ?



Hi,

Documentation for GtkDialog says:

.... If the dialog is destroyed, gtk_dialog_run() returns GTK_RESPONSE_NONE.....

(see http://developer.gnome.org/doc/API/2.0/gtk/gtkdialog.html#GTK-DIALOG-RUN)

How can I check this assertion ?



Test case:
-------------------

#include <gtk/gtk.h>

int
main (int argc, char** argv)
{
    GtkWidget* widget;
    gint result;

    widget = gtk_dialog_new ();
    gtk_dialog_add_buttons (GTK_DIALOG (widget), "Button 1", 1, "Button 2", 2,
"Button 3", 3, NULL);

    gtk_widget_destroy (widget);

    result = gtk_dialog_run (GTK_DIALOG (widget));

    if (result != GTK_RESPONSE_NONE)
    {
        printf ("gtk_dialog_run () should return GTK_RESPONSE_NONE\n");
    }
}

-------------------
Output:

(process:21100): Gtk-CRITICAL **: file gtktypeutils.c: line 40
(gtk_type_unique): assertion `GTK_TYPE_IS_OBJECT (parent_type)' failed
(process:21100): Gtk-CRITICAL **: file gtkdialog.c: line 849 (gtk_dialog_run):
assertion `GTK_IS_DIALOG (dialog)' failed


Is this test case correct ?
If yes, why I get these assertion warnings above ?



Thanks,
Sergey





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