gpt4 book ai didi

c++ - wxTimer 在启动时运行。需要的时候需要启动它。(wxWidgets, Code::Blocks, C++)

转载 作者:行者123 更新时间:2023-11-30 05:13:29 25 4
gpt4 key购买 nike

这可能是一个愚蠢的 wx 新手问题,但我是这个 IDE 的新手。

当使用 wxTimer 时,将其添加到 wxFrame 中,它会在启动时运行。我可以在我的应用程序启动后停止它并启动它,但最初它会运行。

使用 wxTimer 首先将它添加到 wxFrame。然后双击新的 wxTimer 控件图标来创建一个这样的事件:

void wxSQLi_417Frame::OnTimer1Trigger(wxTimerEvent& event)
{
DisUpdate();
}

现在添加 Timer1.Start();
它怎么能在启动时空闲,直到发送一个

Timer2.Start();

?

最佳答案

来自documentation :

In any case, you must start the timer with wxTimer::Start() after constructing it before it actually starts sending notifications.

因此,如果您的计时器正在运行,则您必须明确启动它。

关于c++ - wxTimer 在启动时运行。需要的时候需要启动它。(wxWidgets, Code::Blocks, C++),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43939882/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com