【发布时间】:2021-12-30 13:59:35
【问题描述】:
我正在尝试将一个古老的 GTK+ 应用程序移植到 GTK2 并遇到以下问题:在 GTK+ 版本中,gtk_events_pending( ) 给出 0,而在 GTK2 版本中给出了 1。代码的更改很少,所以我不明白为什么同一个函数在 GTK+ 和 GTK2 中返回不同的值。所以我试图找出哪个事件未决:
if (gtk_events_pending( ) == 0) {
fprintf(stderr, "gtk_events_pending=0\n");
} else {
fprintf(stderr, "gtk_events_pending=1\n");
if ( gtk_get_current_event () == NULL ) {
fprintf(stderr, "current event is NULL\n");
}
}
但是,我总是将 NULL 作为当前事件。怎么会这样?
【问题讨论】: