Using Wt 3.1.1b on Mac OS 10.6.2, I'm creating a popup menu.
in the event handler, fileMenu_->result() returns 0.

I'm fairly certain this used to work.

Should I have a separate event handler for each menu item, rather than relying 
on the return value from WPopupMenu::result() ?

    WHBoxLayout *hbox0 = new WHBoxLayout();

    fileMenu_ = new WPopupMenu();
    fileMenu_->addItem("New");
    fileMenu_->addItem("Open");
    saveMenuItem_ = fileMenu_->addItem("Save");
    saveMenuItem_->triggered().connect(SLOT(this, UIServer::fileMenuClicked));

    fileMenu_->addItem("Save As");
    WLabel *fileMenuLabel = new WLabel("File");
    fileMenuLabel->clicked().connect(SLOT(fileMenu_, WPopupMenu::popup));
    fileMenuLabel->setStyleClass("popupmenuLabel");
    hbox0->addWidget(fileMenuLabel, 0, AlignLeft | AlignTop);
    vbox1_->addLayout(hbox0);


// user clicked on file menu
void UIServer::fileMenuClicked()
{
    WPopupMenuItem *menuItem= fileMenu_->result();
    if (menuItem == saveMenuItem_) {
        writeConfiguration(currentConfigurationFile_);
    }
}




------------------------------------------------------------------------------
Download Intel® 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