Re: Odd behavior using Gtk::Window::move
- From: Fernando Tarín <lists im gmail com>
- To: gtkmm-list gnome org
- Subject: Re: Odd behavior using Gtk::Window::move
- Date: Fri, 30 Jul 2010 22:18:16 +0200
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
<lists.im@gmail.com> 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]