After some more research nothing better that answer the question myself. For the record I confused set_position(Gtk::WIN_POS_NONE); with set_gravity(Gdk::GRAVITY_CENTER); when that line is fixed it works like a charm.
I hope that this will be useful to someone else. Fernando On Wed, Jul 28, 2010 at 11:17 PM, Fernando Tarín <[email protected]> wrote: > Hi I am getting and odd behavior using Gtk::Window::move. I will explain it > using the next piece of code as base: > > class MainWindow: public Gtk::Window{ > protected: > void on_signal_resize(GdkEventConfigure*); > public: > MainWindow(); > ~MainWindow(); > }; > > MainWindow::MainWindow(): > { > bool is_maximized = false; > set_title("Test"); > set_border_width(1); > ... > show_all_children(); > ... > > if (is_maximized){ > maximize(); > } > set_position(Gtk::WIN_POS_NONE); > resize(300, 400); > move(0, 50); > > signal_configure_event().connect_notify( sigc::mem_fun(*this, > &MainWindow::on_signal_resize) ); > } > > void MainWindow::on_signal_resize(GdkEventConfigure *ec){ > std::cout << "Position: (" << ec->x << ", " << ec->y << ")" << > std::endl; > std::cout << "Size: (" << ec->width << ", " << ec->height << ")" << > std::endl; > } > > The thing is that the window is never moved to the y value that I specify > at move. > Using the signal event I can get the real number, ec->y always return the > value that I specify at move plus 25, 75 in this case. > I have tried different window managers (metacity & compiz). > > Any ideas? > > Thanks in advance. > Fernando > > > > >
_______________________________________________ gtkmm-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtkmm-list
