Re: How to manage a window flowing over another?



"Bluez Zhao" <zhyforever 163 net> writes: 
> I create the two windows use gtk_window_new(). If I set the first one as
> GTK_WINDOW_POPUP, then the second can't be set as transient for it. If I set
> the second one as GTK_WINDOW_POPUP, it can be set transient but it can't be
> moved. What should I do?
>

Don't use GTK_WINDOW_POPUP. Just turn off decorations with
gdk_window_set_decorations().

> And another question, there are many times I need to use an GdkWindow as
> argument, but I create the widget as a GtkWidget, if I use widget->window, it
> often gives warnings and fails when it's run. How can I know if a GtkWidget
> has a GdkWindow?
>

It has a GdkWindow after it's a realized. A window will be realized
when a) it's shown b) its container and its parents are shown c) one
of the containers it's inside is a toplevel window.

(Simple solution: if you need a window to be realized, do whatever
task you want to do in a signal handler connected to "realize" with
connect_after().)

Havoc




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