当前位置: 技术问答>linux和unix
gtk编程
来源: 互联网 发布时间:2016-12-10
本文导语: gtk中的gtk_window_get_screen,gtk_widget_get_toplevel是干什么用的? 要起到什么效果时用这函数? 如果在要用的地方去掉会有什么后果呢?谢谢~~~~~ | 以前搞的时候只要界面能运行就不管那么多了 看...
gtk中的gtk_window_get_screen,gtk_widget_get_toplevel是干什么用的?
要起到什么效果时用这函数?
如果在要用的地方去掉会有什么后果呢?谢谢~~~~~
要起到什么效果时用这函数?
如果在要用的地方去掉会有什么后果呢?谢谢~~~~~
|
以前搞的时候只要界面能运行就不管那么多了
看了下手册还是不明白
gtk_window_get_screen
Returns the GdkScreen associated with window.
gtk_widget_get_toplevel
This function returns the topmost widget in the container hierarchy widget is a part of. If widget has no parent widgets, it will be returned as the topmost widget. No reference will be added to the returned widget; it should not be unreferenced.
Note the difference in behavior vs. gtk_widget_get_ancestor(); gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW) would return NULL if widget wasn't inside a toplevel window, and if the window was inside a GtkWindow-derived widget which was in turn inside the toplevel GtkWindow. While the second case may seem unlikely, it actually happens when a GtkPlug is embedded inside a GtkSocket within the same application.
To reliably find the toplevel GtkWindow, use gtk_widget_get_toplevel() and check if the TOPLEVEL flags is set on the result.
看了下手册还是不明白
gtk_window_get_screen
Returns the GdkScreen associated with window.
gtk_widget_get_toplevel
This function returns the topmost widget in the container hierarchy widget is a part of. If widget has no parent widgets, it will be returned as the topmost widget. No reference will be added to the returned widget; it should not be unreferenced.
Note the difference in behavior vs. gtk_widget_get_ancestor(); gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW) would return NULL if widget wasn't inside a toplevel window, and if the window was inside a GtkWindow-derived widget which was in turn inside the toplevel GtkWindow. While the second case may seem unlikely, it actually happens when a GtkPlug is embedded inside a GtkSocket within the same application.
To reliably find the toplevel GtkWindow, use gtk_widget_get_toplevel() and check if the TOPLEVEL flags is set on the result.
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。