Hi Koen,

the problem was as follows:

Wt 3.2.3 code which worked:
{
       setImplementation(impl_);
       impl_->addWidget(icon1_);
       impl_->addWidget(icon2_);
       impl_->setLoadLaterWhenInvisible(false);
       ...
}


Wt 3.3.0 code which works:
{
       impl_->addWidget(icon1_);
       impl_->addWidget(icon2_);
       impl_->setLoadLaterWhenInvisible(false);
       setImplementation(impl_);
       ...
}

The second setImplementation() call was just a copy&paste error in my 
last email... ;-)

Stefan

Am 22.02.2013 14:41, schrieb Koen Deforche:
> Hey,
>
> setImplementation() should be the first call in a WCompositeWidget, it
> seemed that you called it twice before ? Perhaps yes, this is not
> something that is handled correctly.
>
> Regards,
> koen
>
>
> 2013/2/22 Stefan Ruppert <s...@myarm.com <mailto:s...@myarm.com>>
>
>     Hi,
>
>     ok I have found the problem. It was in the WImagePair class:
>
>     The following code produced the core:
>     WImagePair::WImagePair(WImage* image1, WImage* image2,
>                           bool clickIsSwitch, WContainerWidget *parent)
>         : WCompositeWidget(parent),
>           impl_(new WContainerWidget()),
>           icon1_(image1),
>           icon2_(image2)
>     {
>         setImplementation(impl_);
>         impl_->addWidget(icon1_);
>         impl_->addWidget(icon2_);
>         impl_->setLoadLaterWhenInvisible(false);
>         setImplementation(impl_);
>
>         ...
>     }
>
>
>     And this fixes the core ;-)
>
>     WImagePair::WImagePair(WImage* image1, WImage* image2,
>                           bool clickIsSwitch, WContainerWidget *parent)
>         : WCompositeWidget(parent),
>           impl_(new WContainerWidget()),
>           icon1_(image1),
>           icon2_(image2)
>     {
>         impl_->addWidget(icon1_);
>         impl_->addWidget(icon2_);
>         setImplementation(impl_);
>         /* ^^^^^^^^^^^^^^^
>            Seems to me that the setImplementation() method has changed... */
>
>         impl_->setLoadLaterWhenInvisible(false);
>
>         ...
>     }
>
>     Stefan
>
>     Am 22.02.2013 12:03, schrieb Stefan Ruppert:
>      > Hi,
>      >
>      > I found the cause of the crash. Within our Wt app we wanted to
>     use the
>      > WIconPair class. But with a sligthly modified WImage class.
>     Therefore I
>      > copied the WIconPair to WImagePair which gets just already created
>      > WImage objects.
>      >
>      > The custom Image class adds support for showing a disabled
>     (grey'd icon)!
>      >
>      > Adding a WImagePair object to a layout manager results in the
>     previous
>      > mentioned core dump!
>      >
>      > I have attached the apropriate sources.
>      >
>      > class LeftViewShowImage : public Image
>      > {
>      >     public:
>      >        LeftViewShowImage(const Wt::WString& tooltip)
>      >      : Image(tooltip,
>      >         Wt::WLink(Wt::WApplication::resourcesUrl() +
>      > "icons/leftviewshow.png"),
>      >         Wt::WLink(Wt::WApplication::resourcesUrl() +
>      > "icons/leftviewshow_d.png"),
>      >         16, 16) {}
>      > };
>      >
>      > class LeftViewHideImage : public Image
>      > {
>      >     public:
>      >        LeftViewHideImage(const Wt::WString& tooltip)
>      >      : Image(tooltip,
>      >         Wt::WLink(Wt::WApplication::resourcesUrl() +
>      > "icons/leftviewhide.png"),
>      >         Wt::WLink(Wt::WApplication::resourcesUrl() +
>      > "icons/leftviewhide_d.png"),
>      >         16, 16) {}
>      > };
>      >
>      > mToggleLeftView =
>      > new WImagePair(new
>     LeftViewHideImage(WString::tr("leftview-hide-text")),
>      >            new LeftViewShowImage(WString::tr("leftview-show-text")));
>      >
>      > mToggleLeftView->icon1Clicked().connect(this,
>     &Browser::toggleLeftView);
>      > mToggleLeftView->icon2Clicked().connect(this,
>     &Browser::toggleLeftView);
>      >
>      > HBoxLayout* hbox1 = new WHBoxLayout();
>      >
>      > adding this widget to a layout causes the crash!
>      > ====>  hbox1->addWidget(mToggleLeftView);
>      >
>      > Any idea?
>      >
>      >
>      > Regards,
>      > Stefan
>      >
>      >
>      > Am 22.02.2013 10:53, schrieb Stefan Ruppert:
>      >> Hi all,
>      >>
>      >> I'm currently trying to upgrade to Wt 3.3.0 from Wt 3.2.3. Compiling
>      >> just went fine. But during initialization I get the following
>     core dump:
>      >>
>      >> It seems to me that some Widget/Layout we are using is not supported
>      >> anymore!?
>      >>
>      >> assert(false) within WContainerWidget::createLayoutItemImpl()!
>      >>
>      >> Any idea?
>      >>
>      >> Regards,
>      >> Stefan
>      >>
>      >>
>      >> #0  0x00007ffff6045425 in raise () from
>     /lib/x86_64-linux-gnu/libc.so.6
>      >> #1  0x00007ffff6048b8b in abort () from
>     /lib/x86_64-linux-gnu/libc.so.6
>      >> #2  0x00007ffff603e0ee in ?? () from /lib/x86_64-linux-gnu/libc.so.6
>      >> #3  0x00007ffff603e192 in __assert_fail () from
>      >> /lib/x86_64-linux-gnu/libc.so.6
>      >> #4  0x00007ffff733faa7 in Wt::WContainerWidget::createLayoutItemImpl
>      >> (this=<optimized out>, item=0x7fffd4031570) at
>      >> /home/ruppert/work/wt/wt-3.3.0-rc2/src/Wt/WContainerWidget.C:176
>      >> #5  0x00007ffff74d9dc5 in Wt::WWidget::createSDomElement
>     (this=0x3762,
>      >> app=0x376a) at
>     /home/ruppert/work/wt/wt-3.3.0-rc2/src/Wt/WWidget.C:325
>      >> #6  0x00007ffff72b1f16 in Wt::StdWidgetItemImpl::createDomElement
>      >> (this=<optimized out>, fitWidth=<optimized out>,
>     fitHeight=<optimized
>      >> out>, app=0x7fffd4031570) at
>      >> /home/ruppert/work/wt/wt-3.3.0-rc2/src/Wt/StdWidgetItemImpl.C:112
>      >> #7  0x00007ffff72ac267 in Wt::StdGridLayoutImpl2::createElement
>      >
>      >
>      >
>      >
>     
> ------------------------------------------------------------------------------
>      > Everyone hates slow websites. So do we.
>      > Make your web apps faster with AppDynamics
>      > Download AppDynamics Lite for free today:
>      > http://p.sf.net/sfu/appdyn_d2d_feb
>      >
>      >
>      >
>      > _______________________________________________
>      > witty-interest mailing list
>      > witty-interest@lists.sourceforge.net
>     <mailto:witty-interest@lists.sourceforge.net>
>      > https://lists.sourceforge.net/lists/listinfo/witty-interest
>      >
>
>
>     
> ------------------------------------------------------------------------------
>     Everyone hates slow websites. So do we.
>     Make your web apps faster with AppDynamics
>     Download AppDynamics Lite for free today:
>     http://p.sf.net/sfu/appdyn_d2d_feb
>     _______________________________________________
>     witty-interest mailing list
>     witty-interest@lists.sourceforge.net
>     <mailto:witty-interest@lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
>
>
>
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to