Placement of popup ( CellRendererDate from examples )


I'm using some code from the example folder to provide a CellRendererDate in a treeview. I've had some complaints that the calendar goes off-screen if the cell being edited is too far down the screen.

The code that positions the popup is ( from the example script ):

# Align the top right edge of the popup with the the bottom right edge of the
 # cell.
 my ($x_origin, $y_origin) =  $view -> get_bin_window() -> get_origin();

 $popup -> move(
$x_origin + $cell_area -> x() + $cell_area -> width() - $popup -> allocation() -> width(),
   $y_origin + $cell_area -> y() + $cell_area -> height()

How would I go about modifying this to detect whether the calculated y position puts part of the calendar off-screen?

I know ( or I think I know anyway ... I haven't tried it yet ) I can do $popup->allocation to get the size of the popup. But how do I get the screen size?

Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak nusconsulting com au

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