本文介绍了gtk_window_fullscreen问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我需要全屏窗口在我的gtk +应用程序中运行。我尝试使用 gtk_window_fullscreen(GtkWindow * Window): 我有函数: static void full_screen(MainWin * mw) { gtk_window_fullscreen((GtkWindow *)mw); } 当我尝试调用此函数时,我看到错误: Gtk-CRITICAL **:gtk_window_fullscreen:assertion`GTK_IS_WINDOW(window)'failed $ b 其中MainWin: typedef struct _MainWin MainWin; typedef struct _MainWin { GtkWindow parent; GtkWidget * scroll; GtkWidget * box; GtkWidget *工具栏; gboolean full_screen; }; 有什么不对? 谢谢 code>出于某种原因。你不能那样做,你从哪里得到这个想法? 你需要一个小部件指针: GtkWindow *窗口; 然后使用 gtk_window_new(GTK_WINDOW_TOPLEVEL)。 I need in full screen window functional in my gtk+ application. I try to use gtk_window_fullscreen(GtkWindow* Window): I have function:static voidfull_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 解决方案 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). 这篇关于gtk_window_fullscreen问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-26 11:40