second_page.getGlobalBounds()
Is 'second_page' a predefined SFML shape (such as rectangle, circle etc.)? If not, and you defined the getGlobalBounds function yourself, that means you already knew the answer to the rectangle problem
I can't seem to inherit from Shape without causing an ambiguity with Drawable.
Shape itself already inherits from Drawable. Shape also has a specific way of working - it has virtual functions that need overriding. See
this tutorial example.
It does look like you probably want to inherit from Drawable and then just add the getGlobalBounds functions yourself. They only need to return the rectangle's global bounds. In your original class, it would just be something like:
sf::FloatRect getGlobalBounds()
{
return recButton.getGlobalBounds();
}
the mouse isbuttonpressed won't work.
Why, what is it doing that you don't expect it to do?
If you're reading 'clicks', I would agree with Brax that it would be better to use events instead. isButtonPressed is better for times that depend on how long you hold the button e.g. dragging, charging weapon, firing bullets constantly until released. Basically, stuff that needs updating in real-time, rather than a one-off "event" (a single click).
When you test for the button being pressed using events, it also gives you the mouse position at the time of the click. Exactly the information you want when you're programming buttons, right?
Have a look at
the tutorial on events if you need help with it/to refresh your memory of it.