samedi 6 décembre 2014

Connecting a function to a tab in Wt


Vote count:

0




I am using the Wt library to write in C++ a website. I would like to use tabs on that website. To do so I use the WTabWidget.


In the documentation they make a tab and link each tab to a function :



Wt::WTabWidget *examples = new Wt::WTabWidget(this);
examples->addTab(helloWorldExample(), "Hello World");
examples->addTab(chartExample(), "Charts");
examples->addTab(new Wt::WText("A WText"), "WText");


Based on that I wrote this :

WTabWidget *myTab = new WTabWidget(); myTab->addTab(test(), "Test Tab");


But my compiler tells me :



error: cannot initialize a parameter of type 'Wt::WWidget *' with an rvalue of type 'void'


My "test" function has return type void. It's logic an rvalue of type void cannot be assigned to a parameter of type "WWidget*".


But if they show that example in the documentation, why can't I do it?

that : examples->addTab(chartExample(), "Charts");


Thanks for your help!



asked 8 secs ago







Connecting a function to a tab in Wt

Aucun commentaire:

Enregistrer un commentaire