Re: [Nautilus-list] dialog plan



On 01Nov2001 11:51PM (-0500), Havoc Pennington wrote:
> 
> Hi,
> 
> I notice some GnomeDialog are changed to GtkDialog - is the plan to
> try to strip out GnomeDialog entirely? Should I be terminating all
> instances?
> 
> BTW, can I add the appended function to replace gnome_geometry_string?
> 
> Havoc
> 
> /**
>  * eel_gtk_window_get_geometry_string:
>  * @window: a #GtkWindow
>  * 
>  * Obtains the geometry string for this window, suitable for
>  * set_geometry_string(); assumes the window has NorthWest gravity
>  * 
>  * Return value: geometry string, must be freed
>  **/
> char*
> eel_gtk_window_get_geometry_string (GtkWindow *window)
> {
>         char *str;
>         int w, h, x, y;
>         
>         g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
>         g_return_val_if_fail (gtk_window_get_gravity (window) ==
>                               GDK_GRAVITY_NORTHWEST);

Your gtk_return_val_if_fail needs a value there, but besides that, it
seems wrong to fail on some windows because of their gravity
setting. Perhaps it would be a good idea to check the Nautilus callers
of gnome_geometry_string and see whether NULL or a NorthWest-assuming
value would be more useful when then window does not have NorthWest
gravity.
 
>         gtk_window_get_position (window, &x, &y);
>         gtk_window_get_size (window, &w, &h);
>         
>         str = g_strdup_printf ("%dx%d+%d+%d", w, h, x, y);
> 
>         return str;
> }





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