Greetings,

I am working on creating a customised extended Ext::Panel and I am getting
errors when I run (it compiles fine) my code and start a session.  The
constructor of the sub class is below:-

When the session fails depending on how i comment certain blocks out I get
either a "*Segmentation fault*" error or *"assert failed" *in the WContainer
class (I believe its somewhere within the setimplementation block that takes
a layout item).

Am I doing something incorrect or out of sequence?  Could you please assist
and help me correct this?

I am aware of the

*"...This layout manager is applicable only to WContainerWidget container
widgets. You may use it within an Ext::Container indirectly by first setting
a WContainerWidget using a WFitLayout."*

note from the documentation but I am not sure if this may be a reason since
I try to indirectly assign the layout to the Ext::Panel.  There seems to be
an issue with layout managers and Ext::Panels.

Thanks in advance.

----

    //initialiser for class that descends from Ext::Panel
    MyPanel::MyPanel():Ext::Panel(){

 // I create textboxes and button here; connect signals
        resize(WLength(6,WLength::Inch),WLength(7,WLength::Inch));
        uname=new WLineEdit();
        uname->setTextSize(10);
        uname->setMaxLength(10);
        pword=new WLineEdit();
        pword->setTextSize(10);
        pword->setMaxLength(10);
        pword->setEchoMode(WLineEdit::Password);
        WLabel* ulabel=new WLabel("Username");
        ulabel->setBuddy(uname);
        WLabel* plabel=new WLabel("Password");
        plabel->setBuddy(pword);
        Button* b=new Button ("OK");
        b->setDefault(true);
        b->clicked.connect(SLOT(this, MyPanel::LoginUser));
        LoginResult.connect(SLOT(this, MyPanel::Success));
 //set default layout of panel to WBorderLayout
        layout=new Wt::WBorderLayout();
        setLayout(layout);

 //create 2 top to bottom box layouts
        WBoxLayout* top =new WBoxLayout(WBoxLayout::TopToBottom);
        WBoxLayout* center =new WBoxLayout(WBoxLayout::TopToBottom);
 //added 2 box layouts to container widgets
        WContainerWidget* centerwid=new WContainerWidget();
        WContainerWidget* topwid=new WContainerWidget();
        centerwid->setLayout(center);
        topwid->setLayout(top);
 //put gui elements on center widget
 centerwid->layout()->addWidget(ulabel);
        centerwid->layout()->addWidget(uname);
        centerwid->layout()->addWidget(plabel);
        centerwid->layout()->addWidget(pword);
        centerwid->layout()->addWidget(b);
 //finally, added 2 top to bottom widgets to border layout of this
class
        layout->addWidget(topwid, WBorderLayout::North);
        layout->addWidget(centerwid, WBorderLayout::Center);
    }


Regards,
Osei
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to