After lots and lots of trial and error :/ I finally managed to get it work. I just ended up integrating the GTK+ alongside the GTKmm code, so I'm able to draw the whole user interface using Gtkmm but the SFML window is written for GTK+, I guess this will have to do
#include <SFML/Graphics.hpp>
#include <gtkmm.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
using namespace std;
sf::RenderWindow prog;
gboolean on_exposed(GtkWidget *widget,GdkEvent *event, gpointer user) {
prog.clear(sf::Color(255,255,255));
prog.display();
gtk_widget_queue_draw(widget);
return true;
}
class HelloWorld : public Gtk::Window {
public:
HelloWorld();
protected:
virtual bool on_expose();
Gtk::Widget *area;
};
HelloWorld::HelloWorld(){
set_title("SFML!");
GtkWidget* carea;
carea = gtk_drawing_area_new();
area = Glib::wrap(carea);
add(*area);
GdkEventMask mask;
mask = GDK_ALL_EVENTS_MASK;
gtk_widget_add_events(area->gobj(),mask);
gtk_widget_set_can_focus(area->gobj(),true);
gtk_widget_set_size_request(area->gobj(),640,480);
gtk_widget_realize(area->gobj());
gtk_widget_set_double_buffered(area->gobj(),false);
#ifdef WINDOWS
prog.create(GDK_WINDOW_HWND(area->gobj()->window));
#else
prog.create(GDK_WINDOW_XID(area->gobj()->window));
#endif
g_signal_connect(area->gobj(),"expose-event",G_CALLBACK(on_exposed),NULL);
show_all_children();
}
bool HelloWorld::on_expose() {
prog.clear(sf::Color(255,255,255));
prog.display();
area->queue_draw();
return true;
}
int main(int argc,char *argv[]) {
Gtk::Main kit(argc,argv);
HelloWorld helloworld;
Gtk::Main::run(helloworld);
}