No.
http://en.sfml-dev.org/forums/index.php?topic=6112.msg76198#msg76198Maybe go bug tank about that and more gtk-ish callbacks like I do and he will change his mind.
I had a thing to do something very much like flash does when it's in browser tab:
last click landed in gui = all events go to SFGUI(except super special events like closed, resized window etc.),
last click landed outside of gui = all events go to app(+ movements go to GUI event then because it makes sense)
the class that does these methods would wrap around desktop and never show it to client, and you'd add/remove using it's methods and it'd take weak widget ptr and add it to m_Solids if you added a 'solid' widget just now
Full code is on github, but, messy as hell so beware:
https://github.com/FRex/ee/blob/master/src/ee/GUI/Core.cppThis also fails(only place I know where it does, might fail more places) when top level widget is window that has a combobox in it and that combo extends its items list outside of window allocation, it'll the not detect clicks on these items that stick out.
Don't let the comment about coming 'proper fix' (a hack around SFG limitation really..) give you any hope tho.
Also, my repos(ee and Game) are MIT licensed.. so try not to just take(too much) code from it if you don't want to include a .txt file with your end app that has LICENSE file content in it to give me credit.
And there should be check to see that result of lock() in checkForHit is valid shared_ptr.
bool alwaysSend(const sf::Event& event)
{
switch (event.type)
{
default:
return false;
case sf::Event::Closed:
case sf::Event::GainedFocus:
case sf::Event::LostFocus:
case sf::Event::Resized:
case sf::Event::MouseLeft:
case sf::Event::MouseEntered:
return true;
}
}
void GUICore::update(float seconds)
{
m_Desktop.Update(seconds);
}
bool GUICore::handleEvent(const sf::Event& eve)
{
//TODO: improve here
if(eve.type==sf::Event::MouseMoved)//always handle mouse movements..(?)
{
m_Desktop.HandleEvent(eve);
}
if(eve.type==sf::Event::MouseButtonPressed/*&&eve.mouseButton.button==sf::Mouse::Left*/)//cmted for now..
{
checkForHit(sf::Vector2f(static_cast<float>(eve.mouseButton.x),static_cast<float>(eve.mouseButton.y)));
}
if(m_Active)
{
m_Desktop.HandleEvent(eve);
return alwaysSend(eve);//special event
}
if(eve.type==sf::Event::MouseButtonPressed)//hack for combo boxes with long item lists
{
//m_Desktop.HandleEvent(eve);//it caused other bug which fix fixes this one too, if long combo lists come there can be proper fix later
}
return true;// !m_Active == true
}
void GUICore::checkForHit(sf::Vector2f pos)
{
m_Active=true;
for(auto it=m_Solid.begin();it!=m_Solid.end();++it)
{
if((*it).lock()->IsGloballyVisible() && (*it).lock()->GetAllocation().contains(pos)) return;
}
m_Active=false;
}