Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] no background on GTK

Havoc, 

We are trying to implement the SWT.NO_BACKGROUND style. This
style determines with a widget will fill the background when
an expose event happens.

On X, it is possible to do this by setting the background
pixmap of a Window to None.

On GTK, the equivalent API is gdk_window_set_back_pixmap().

If you run the test below, you will see that the shell
will fill its background even though the test is setting
the back pixmap to NULL.

It seems that the background is not filled by X, but it is
been filled by GTK. Havoc is there a away of avoiding this?

Silenio


Here is some code that shows the problem:

public class NoBackgroundTest {

public static void main (String [] args) throws Exception {
        OS.gtk_init_check (new int [] {0}, null);
 
        int shellHandle = OS.gtk_window_new (OS.GTK_WINDOW_TOPLEVEL);
 
        OS.gtk_widget_realize(shellHandle);
 
        int window = OS.GTK_WIDGET_WINDOW(shellHandle);
        OS.gdk_window_set_back_pixmap(window, 0, false);
 
        OS.gtk_widget_show(shellHandle);
 
        while (OS.gtk_main_iteration() != 0);
}
}


Back to the top