Thorsten Werner wrote on Wednesday, November 11, 2009 9:56 AM:
> int posX = 585;
>       int posY = 370;
>       std::vector<TGWidgetElement> ElementLower;
>       for(int i=count_width; i>0; i--)
>       {
>               ElementLower.push_back(TGWidgetElement(posX, posY,
>               "WidgElementSideLower.png")); posX += 15;
>               posY += 15;
>               //this->addChild(ElementLower[count_width]);
>       }
> 
> 
> I'm really stuck here. What am i doing wrong???

Group and other OSG Nodes declare operator= to be non-public so they
cannot be instantiated on the stack (which would easily lead to problems
with OSG's smart pointers); you have to dynamically allocate them.

Try something like this instead:

 int posX = 585;
        int posY = 370;
        std::vector<osg::ref_ptr<TGWidgetElement> > ElementLower;
        for(int i=count_width; i>0; i--)
        {
                ElementLower.push_back(new TGWidgetElement(posX,
posY,"WidgElementSideLower.png"));
            posX += 15;
                posY += 15;
                //this->addChild(ElementLower[count_width]);
        }

-- 
Bryan Thrall
FlightSafety International
[email protected]
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to