Skip to main content

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

This raises the question: What is SWT.NO_BACKGROUND is supposed to do? Let's
say you set up a Canvas with no background that is "in front of" another
widget (drawn last). Shouldn't the other widget show through the canvas?
Instead, it appears that the widget in back is not drawn at all, which means
that nothing is drawn and the desktop shows through the window.

I need a transparent canvas for my application. Why doesn't
SWT.NO_BACKGROUND give me that?

Bob
Object Factory Inc.

----- Original Message -----
From: <Silenio_Quarti@xxxxxxx>
To: <platform-swt-dev@xxxxxxxxxxx>
Sent: Thursday, April 04, 2002 3:24 PM
Subject: [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);
> }
> }
> _______________________________________________
> platform-swt-dev mailing list
> platform-swt-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/platform-swt-dev
>



Back to the top