Hello!

I create WDialog with WPushButton and set focus on button. Executing
dialog in first time shows button correctly. But follow dialog
executing not focusing button.

Try this example:

#include <Wt/WApplication>
#include <Wt/WPushButton>
#include <Wt/WDialog>

using namespace Wt;

class TestApp : public WApplication
{
public:
        TestApp(const WEnvironment& env);
        
private:        
        void event();
};

TestApp::TestApp(const WEnvironment& env)
: WApplication(env)
{
        WPushButton* btn = new WPushButton("push me", root());
        
        btn->clicked().connect(this, &TestApp::event);
}

void TestApp::event()
{
        WDialog dlg("");
        WPushButton ok("ok", dlg.contents());
        ok.setFocus();
        ok.clicked().connect(&dlg, &WDialog::accept);
        dlg.exec();
}

WApplication *createApplication(const WEnvironment& env)
{
        return new TestApp(env);
}

int main(int argc, char **argv)
{
        return WRun(argc, argv, &createApplication);
}

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to