problems with GtkPaned and allocation/set_position



[ major caveat: working with gtk+ 1.2 ]

i don't know if this has gotten any better with gtk+2, but in the 1.2
series, attempts to use gtk_paned_set_position() before the paned has
been allocated its final size result in failure. the position is
clamped to the initial allocation size, and thus when later
allocations occur that expand the size, the original position is never
used.

to fix this, i have had to use a connect_after signal handler for the
allocation signal, and within that signal check to see if the
allocation is large enough for the desired position, then set it, and
then disconnect (or make sure the set_position() is not called again,
since this causes an endless cycle of set_position() -> queue_resize()
-> size_allocate() signals).

this all seems very messy. has it been improved in gtk+2, and if not,
is it likely to be?



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