Here is ButtonTest.cpp (the only cpp file in the above archive)
#include <SFGUI/Window.hpp>
#include <SFGUI/Desktop.hpp>
#include <SFGUI/Box.hpp>
#include <SFGUI/Table.hpp>
#include <SFGUI/Label.hpp>
#include <SFGUI/Entry.hpp>
#include <SFGUI/Button.hpp>
#include <SFGUI/Context.hpp>
#include <SFGUI/Engine.hpp>
#include <SFML/Graphics.hpp>
#include <string>
#include <sstream>
#include <cstdlib>
sf::RenderWindow* screen;
void OnButtonClicked()
{
}
int main(int argc, char* argv[])
{
// Initialize the time
screen = new sf::RenderWindow();
screen->Create(sf::VideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP), "Button Test");
// Create two buttons, one Client and one Server
sfg::Button::Ptr cbutton( sfg::Button::Create( "Test" ) );
cbutton->OnClick.Connect( &OnButtonClicked );
// Create a vertical box layout width 5 pixels spacing and add the label
// and button to it.
sfg::Box::Ptr box( sfg::Box::Create( sfg::Box::VERTICAL, 5.f ) );
box->Pack( cbutton, false );
// Create a window and add the box layouter to it. Also set some properties.
sfg::Window::Ptr window( sfg::Window::Create() );
window->Add( box );
window->SetTitle( "Testing" );
window->SetStyle( 3 ); // Title and Background
window->SetPosition(
sf::Vector2f(
static_cast<float>( screen->GetWidth() / 2 ) - window->GetAllocation().Width / 2.f,
static_cast<float>( screen->GetHeight() / 2 ) - window->GetAllocation().Height / 2.f
)
);
// Create a desktop and add the window to it. We need to specify the desktop
// area we want to use. In this case we use SFML window's whole area and
// therefore give it our render window to use its size.
sfg::Desktop desktop( *screen );
desktop.Add( window );
// Main loop!
sf::Event event;
while( ButtonClicked == 0 )
{
// Event processing.
while( screen->PollEvent( event ) )
{
desktop.HandleEvent( event );
// If window is about to be closed, leave program.
if( event.Type == sf::Event::Closed )
{
screen->Close();
}
}
// Rendering.
screen->Clear();
desktop.Expose( *screen );
screen->Display();
}
screen->Clear();
return 0;
}
This is the output of the debugger:
'ButtonTestd.exe': Loaded 'C:\Users\Terohnon\Downloads\ButtonTest\bin\ButtonTestd.exe', Symbols loaded.
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Users\Terohnon\Downloads\ButtonTest\bin\sfml-graphics-2.dll', Binary was not built with debug information.
'ButtonTestd.exe': Loaded 'C:\Users\Terohnon\Downloads\ButtonTest\bin\sfml-window-2.dll', Binary was not built with debug information.
'ButtonTestd.exe': Loaded 'C:\Users\Terohnon\Downloads\ButtonTest\bin\sfml-system-2.dll', Binary was not built with debug information.
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\msvcp100.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\msvcr100.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\opengl32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\glu32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\ddraw.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\dciman32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\devobj.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Users\Terohnon\Downloads\ButtonTest\bin\sfgui.dll', Binary was not built with debug information.
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded.
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\apphelp.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\AppPatch\AcLayers.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\userenv.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\profapi.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\winspool.drv', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\mpr.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\atiglpxx.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\atioglxx.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\atigktxx.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\aticfx32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\atiadlxy.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\wtsapi32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\psapi.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\wintrust.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\crypt32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\msasn1.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Unloaded 'C:\Windows\SysWOW64\atigktxx.dll'
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\atigktxx.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\dinput.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\hid.dll', Cannot find or open the PDB file
First-chance exception at 0x61ea980b in ButtonTestd.exe: 0xC0000005: Access violation reading location 0xbaadf011.
Unhandled exception at 0x77a115ee in ButtonTestd.exe: 0xC0000005: Access violation reading location 0xbaadf011.
The program '[2420] ButtonTestd.exe: Native' has exited with code -1073741819 (0xc0000005).
Note: This was done on a 64bit Windows 7 System, but the error is the same as the 32 bit system.