如何替换GDK_INCLUDE_INFERIORS?
由于大多数 gdk_gc_*
方法在 GTK+ 3 中已被弃用,那么如何仅使用 Cairo 在子窗口上进行绘制呢?下面是我想要实现的一个简单示例:
GdkWindow *tl_window = parent_widget->window;
GdkGC *gc = gdk_gc_new(tl_window1->window);
gdk_gc_set_subwindow(gc, GDK_INCLUDE_INFERIORS);
gdk_gc_set_exposures(gc, FALSE);
do_my_painting(tl_window, gc);
gdk_gc_unref(gc);
http://developer.gnome.org/gdk/stable/gdk-Graphics-Contexts.html#gdk-gc-set-subwindow 表示 GDK_INCLUDE_INFERIORS
将用于来源。所以我认为诀窍是创建窗口的源,然后......那么......我被困住了。
Since most of the gdk_gc_*
methods are deprecated in GTK+ 3, how does one paint on sub-windows using Cairo only? Below is a simple example of what I would like to achieve:
GdkWindow *tl_window = parent_widget->window;
GdkGC *gc = gdk_gc_new(tl_window1->window);
gdk_gc_set_subwindow(gc, GDK_INCLUDE_INFERIORS);
gdk_gc_set_exposures(gc, FALSE);
do_my_painting(tl_window, gc);
gdk_gc_unref(gc);
http://developer.gnome.org/gdk/stable/gdk-Graphics-Contexts.html#gdk-gc-set-subwindow says GDK_INCLUDE_INFERIORS
will be used on sources. So I assume the trick is to create a source of the window and then ... well then ... I'm stuck.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我自己找到了一个解决方案
(我在这里错过了对 cairo_new 的破坏吗?)
我还找到了下一个链接(没有测试它)http://mail.gnome.org/archives/commits-list/2010-August/msg03385.html 他们似乎使用像素图而不是表面。
Found a solution myself
(do I mis a destroy of cairo_new here ?)
I also found the next link (did not test it) http://mail.gnome.org/archives/commits-list/2010-August/msg03385.html where they seem to use a pixmap instead of a surface.