Re: How do you get current window geometry?




  'Hey all..

  Anyone know how to get the current window geometry? 

  I've been able to nab the height and width in several different ways,
but am always getting values of -1 from things like
$window->TOPLEVEL->x.

  I even discovered:

($x,$y,$w,$h,$d) = $window->TOPLEVEL->window->get_geometry() 

  from the sample programs (looks like this is getting 'down into' GDK?)
but it still does not return the _current_ window position.

  This cant be all that difficult.. 'anyone know offhand?

Try Gtk::Gdk::Window::get_position by the folowwing way:

(x,y) = $widget->window->get_position()

-- 
Best regards
Pavel.






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]