Pregunta

In Windows, it is possible to say

CreateWindow("myclass",...,WS_CHILD,...);

or

CreateWindow("myclass",...,WS_OVERLAPPEDWINDOW,...);

It is also possible to switch appearance at will:

SetWindowLongPtr((HWND)handle,GWL_STYLE,style_1);
SetWindowPos((HWND)handle,HWND_TOP,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER |   SWP_FRAMECHANGED);
SetWindowLongPtr((HWND)handle,GWL_EXSTYLE,style_0);
SetWindowPos((HWND)handle,HWND_TOP,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
if(style_1&WS_CHILD)
    {
    HWND owner=GetWindow((HWND)handle,GW_OWNER);
    SetParent((HWND)handle,owner);
    }
else
    {SetParent((HWND)handle,NULL);}

It seems to me that most other GUI toolkits make a clear distinction between top-level windows and other widgets. The question is if and how it is possible to implement similar behavior in GTK on X

¿Fue útil?

Solución

There is a GTK_WINDOW_TOPLEVEL and GTK_WINDOW_POPUP - unless you know what you do use the first. Also RTM https://developer.gnome.org/gtk3/stable/gtk3-Standard-Enumerations.html#GtkWindowType


You need to create a GtkWindow or GtkMainWindow and then add your desired widget x via gtk_container_add to the window you created.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top