#include <iostream>
using namespace std;

#include <gtkmm.h>
#include <goocanvasmm.h>

int main(int argc, char *argv[])
{

    Gtk::Main kit(argc, argv);
    Goocanvas::init("Test", "0.1", argc, argv);
    Gtk::Window win;
    Goocanvas::Canvas canvas;
    win.add(canvas);
    Glib::RefPtr<Goocanvas::Item> root = canvas.get_root_item();

    Glib::RefPtr<Goocanvas::Text> txt = Goocanvas::Text::create( "W1234I", 0, 0 );
    txt->property_font()="Serif Bold 6";
    txt->property_fill_color_rgba()= 0x000000FF;  
    root->add_child( txt );  

    // if the following 2 dummy c-code lines exists here, the output is valid
    // if the follwoing two lines did not exsist, the output is allways 0 for width and height
    GooCanvasBounds bounds;
    goo_canvas_item_get_bounds (( GooCanvasItem*)txt->gobj(), &bounds);

    Goocanvas::Bounds b = txt->get_bounds();

    cout << "Width:  " << b.get_x2() - b.get_x1() << endl;
    cout << "Height: " << b.get_y2() - b.get_y1() << endl;

    win.show_all_children();
    Gtk::Main::run(win);
}
