gtk_window_fullscreen problem

核能气质少年 提交于 2019-12-11 13:09:16

问题


I need in full screen window functional in my gtk+ application. I try to use gtk_window_fullscreen(GtkWindow* Window):

I have function:

static void
full_screen(MainWin *mw)
{
    gtk_window_fullscreen((GtkWindow*)mw);
}

When i try to call this function i see error:

Gtk-CRITICAL **: gtk_window_fullscreen: assertion `GTK_IS_WINDOW (window)' failed 

Where MainWin:

typedef struct _MainWin MainWin; 

typedef struct _MainWin 
{ 
    GtkWindow parent; 
    GtkWidget* scroll; 
    GtkWidget* box; 
    GtkWidget *toolbar; 
    gboolean full_screen; 
};

What's wrong?

Thank you


回答1:


You're (still) trying to weirdly subclass GtkWindow for some reason. You can't do that like that, where did you get this idea?

You need to have a widget pointer:

GtkWindow *window;

Then create the window using gtk_window_new(GTK_WINDOW_TOPLEVEL).



来源:https://stackoverflow.com/questions/3035039/gtk-window-fullscreen-problem

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!