a ? about gtk_fixed_set_has_window()



Hi,

The documentation for gtk_fixed_set_has_window () says:

"Sets whether a GtkFixed widget is created with a separate GdkWindow for
widget->window or not."


I wrote a test case which shows that widget->window is always not NULL.


#include <gtk/gtk.h>

void test (gboolean has_window);

int
main (int argc, char** argv)
{
    gtk_init (&argc, &argv);

    test (TRUE);
    test (FALSE);
}

void test (gboolean has_window)
{
    GtkWidget *widget;
    GtkWidget *window;

    widget = gtk_fixed_new ();
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

    gtk_fixed_set_has_window (GTK_FIXED (widget), has_window);
    gtk_container_add (GTK_CONTAINER (window), widget);
    gtk_widget_show_all (window);

    printf ("\nhas_window = %d\n", has_window);
    printf ("(widget->window == NULL) = %d\n", widget->window == NULL);
}


Output:

has_window = 1
(widget->window == NULL) = 0

has_window = 0
(widget->window == NULL) = 0



What's wrong in the test case?

Thanks,
    Vitaly.








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