【问题标题】:FLTK Wait for event to close windowFLTK 等待事件关闭窗口
【发布时间】:2011-11-22 10:19:52
【问题描述】:

我基本上有一个带有收件箱和输入按钮的窗口。我怎样才能使窗口保持打开和绘制,直到用户输入收件箱并点击输入按钮。

Window w(Point(100,100),200,200, "Category Sales");
Button enter(Point(25,25),110,25,"Enter",enter);
In_box cat_in(Point(75,75),100,20,"Category:");
w.attach(cat_in);
w.attach(enter);
Fl::wait();
if(ent==true)
{
category = cat_in.get_string();
reference_to<My_button>(addr).receiver->do_categories();
}

有没有比输入按钮更好的方法来做到这一点?

【问题讨论】:

    标签: c++ user-interface fltk


    【解决方案1】:

    Fl::wait() 是错误的函数。 (阅读文档以了解更多详细信息)

    您真正需要的是在该函数的末尾调用 Fl::run()。 (我假设这是在 main() 函数内部)。我强烈建议您阅读(相当不错的)FLTK 1 文档,并熟悉该工具包。源代码树中的示例是一个很好的信息来源。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-12-29
      • 1970-01-01
      • 1970-01-01
      • 2021-05-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多