adjustments in a GtkLayout




I had a problem when trying to use a GtkLayout: I did not put it in a scrolled
window, and did not manually create the adjustments.
Therefore, layout->hadjustment was null.

This created a segmentation fault in gtk_layout_size_allocate().

This is apparently one of the very few places in gtklayout.c where the author
does not test whether the adjustments have been created or not.
Instead, he simply does something like:

   layout->hadjusment->page_size = ...
                    ^^^^^
                    invalid, of course


I do not know if putting a GtkLayout in a scrolled window is mandatory, and in
any case it seems that we should not have to created the adjustments ourselves
if they are mandatory.
The code in gtk_layout_size_allocate should be protected by testing whether
the adjustments are null or not...

thanks,

Emmanuel



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