Re: [gtk-list] Bugs in Gtk+/Glib-1.2.4

Marting.Weber wrote:
> I ported the GIMP plugin gflare to Gtk 1.2.x. But when I call it I get some
> error message. I think it is a Gtk problem and not a gflare problem. Please
> tell me if it is my problem.
> The second message appears when clicking on edit:
> Gtk_WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with
> width 65505 and height 65531
> Please help to fix the bug. Here is the exact place where you can find the
> gflare_ plugin for GIMP:
> Yours
> Martin

also i have faced with this subtle error and imho is more serious than
could appear.
Hard to believe but this error can blow down  linux kernel (almost mine 2.2.6) 
without recovery.
As far i have understood happens when you make a too premature
You should actually be able to work around with doing size_request and
size_allocate prior to your own realization of the window  keping the
invariants that gtk_window_show() in gtkwindow.c enforces 
Is a gross hack that should be removed as the bug will be fixed
(i guess in 1.2.5)
Here the code:

    GtkWidget* widget = gtk_somewidget_new();
    GtkRequisition requisition;
    GtkAllocation allocation = { 0, 0, 200, 200 };
    gtk_widget_size_request (,widget  &requisition);
    if (requisition.width || requisition.height)
    allocation.width = requisition.width;
    allocation.height = requisition.height;
    gtk_widget_size_allocate (widget , &allocation);  
   gtk_widget_realize(widget );

hope this helps.
Mario Motta, AI Research Group - Rimini;

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