Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFGUI ScrolledWindow problem  (Read 989 times)

0 Members and 1 Guest are viewing this topic.

MenosGrandes

  • Newbie
  • *
  • Posts: 7
    • View Profile
SFGUI ScrolledWindow problem
« on: August 01, 2015, 03:38:43 pm »
Hi I have little problem..
When I'm adding elements to ScrolledWindow I have error.

I have class that is container for elements :
   

class RuleAxiomGUI
{
public :
    sfg::Entry::Ptr entryAxiom,entryRule;
    sfg::Label::Ptr labelRule,labelAxiom,labelProbabilityOfAxiom;
    sfg::Adjustment::Ptr probabilityOfAxiom;

    void Add(std::string labelA,std::string labelR,int number,sfg::Box::Ptr box);
    void ProbabilityChange();

};
 
And a method in GUI class that adding elements to sfg::Box::Ptr :

void GUI::AddRule()
{
static int counter=0;
counter++;
SharedRuleAxiomGUI ra(new RuleAxiomGUI());
ra->Add("Axiom","Rule",counter,m_boxAddFractalsViewport);

}
 

I'm creating simple ScrolledView like in tutorial on git so :


/* Create the ScrolledWindow.*/
        auto scrolledwindow2 = sfg::ScrolledWindow::Create();

/* Set the ScrolledWindow to always show the horizontal scrollbar and only show the vertical scrollbar when needed.*/
        scrolledwindow2->SetScrollbarPolicy(  sfg::ScrolledWindow::VERTICAL_AUTOMATIC );
/*Box for viewport*/
    m_boxAddFractalsViewport = sfg::Box::Create( sfg::Box::Orientation::VERTICAL, 5.0f );

/*Add the ScrolledWindow box to the ScrolledWindow and create a new viewport automatically.*/
        scrolledwindow2->AddWithViewport( m_boxAddFractalsViewport );
/* Always remember to set the minimum size of a ScrolledWindow.*/

        scrolledwindow2->SetRequisition( sf::Vector2f( 200.f, 600.f ) );

...

    m_boxAddFractals->Pack(scrolledwindow2,false,true);

 

In debug error occures when I want to add 4-th RuleAxiom and I have this :
#0 0xb7d3ca46   sfg::Container::HandleEvent(sf::Event const&) () (/usr/local/lib/libsfgui.so:??)
#1 0xb7de17b4   sfg::Viewport::HandleEvent(sf::Event const&) () (/usr/local/lib/libsfgui.so:??)
#2 0xb7d3ca52   sfg::Container::HandleEvent(sf::Event const&) () (/usr/local/lib/libsfgui.so:??)
#3 0xb7d3ca52   sfg::Container::HandleEvent(sf::Event const&) () (/usr/local/lib/libsfgui.so:??)
#4 0xb7d3ca52   sfg::Container::HandleEvent(sf::Event const&) () (/usr/local/lib/libsfgui.so:??)
#5 0xb7d3ca52   sfg::Container::HandleEvent(sf::Event const&) () (/usr/local/lib/libsfgui.so:??)
#6 0xb7d3e6d6   sfg::Desktop::HandleEvent(sf::Event const&) () (/usr/local/lib/libsfgui.so:??)
#7 0x804d101    main() (main.cpp:45)
 
main.cpp:45 is:
            gui->desktop.HandleEvent( event );

Is it bug or what?...

Its also on SFGUI forum :
http://sfgui.sfml-dev.de/forum/post2420.html#p2420
« Last Edit: August 01, 2015, 04:06:53 pm by MenosGrandes »

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: SFGUI ScrolledWindow problem
« Reply #1 on: August 01, 2015, 03:52:56 pm »
Have you considered asking in the SFGUI Forum?