如何知道何时完全显示Gtk窗口? [英] How to know when a Gtk Window is fully shown?

查看:51
本文介绍了如何知道何时完全显示Gtk窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道完全显示 Gtk.Window 时发出的信号,而完全显示则表示窗口本身及其小部件也显示.

I'd like to know which signal is emitted when a Gtk.Window is fully shown, with fully shown I mean the window itself is shown and its widgets too.

我尝试了几种信号:

  • 显示
  • 实现
  • visibility-notify-event
  • set_focus

但它们都无法正常工作.

but none of them works properly.

我在网上找到的唯一有趣的答案是.

The only interesting answer I found on the web is this.

推荐答案

GtkWidget :: draw 信号(在GTK + 2中以前称为 expose ).

Connect a callback after the GtkWidget::draw signal (previously called expose in GTK+2).

附录

还有其他东西在起作用: double缓冲客户端窗口和(为什么不是吗?)小部件可以在空闲回调中延迟其绘制的事实.

There is other stuff that comes into play: double buffering, client-side windows and (why not?) the fact that a widget can defer its drawing in an idle callback.

如果您想知道主窗口何时第一次出现,那么添加

If you want to know when your main window appears the first time, it is far easier (and saner) add a g_idle_add after your show_all call.

这篇关于如何知道何时完全显示Gtk窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆