问题描述
我有以下结构,
typedef struct _MainWin
{
GtkWindow parent;
GtkWidget* scroll;
GtkWidget* box;
}MainWin;
我创建了从这种结构的应用程序主窗口。现在我需要在全屏幕的主窗口。当我试图打电话,
I have created the application main window from this structure. Now I need the main window in full screen. When I tried to call,
gtk_window_fullscree(GTK_WINDOW(mw);
其中, MW
是 MainWin能够
的对象。我得到了以下错误消息 gtk_window_fullscreen:断言
GTK_IS_WINDOW(窗口)failed`
Where mw
is object of MainWin
. I got the following error message gtk_window_fullscreen: assertion
GTK_IS_WINDOW (window)' failed`
我怎么能带领 MW
到的GtkWindow
?
感谢您。
推荐答案
这似乎是错误的。您的GtkWindow应该是一个指针过了,通过创建的
像任何其他的GTK +部件。这看起来像你想继承了的GtkWindow结构,我不认为你可以做到这样。
This seems wrong. Your GtkWindow should be a pointer too, and created using gtk_window_new()
like any other GTK+ widget. This looks like you're trying to "subclass" the GtkWindow struct, which I don't think you can do like this.
这篇关于C / GTK转换结构的GtkWindow的类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!