Re: GtkWindow and GtkPaned and check-resize



On Tue, 2003-05-27 at 21:57, Paul Davis wrote:
> >On Tue, 2003-05-27 at 18:33, Marcin Krzyzanowski wrote:
> >> Hi,
> >> 
> >> I have a strange problem.
> >> 
> >> I have a window, inside I put GtkPaned, and conenct to window as
> >> GTK_CONTAINER() to signal check-size, I suppose that it shoult be
> >> invoked only when window resize, but is is also when I move divider up
> >> or down, why ?
> >
> >check-resize is nothing you want to connect to ... it's very much
> >an internal implementation detail.
> >
> >> or could anybody tell me how to get moment when window window resized
> >> right ? I tried size-request, but there is the same situation. All I
> >> want to do is change divider position after window resize.
> >
> >::configure-event is probably best ... note that you'll need to
> >look the size in the event, since when ::configure-event is received
> >the widgets in the layout have not yet been layed out at the new
> >size.
> 
> heh, heh. i wrote about this last week (not sure if i got a reply, i
> was gone). i don't know much about Paned has changed for gtk+2, but
> in gtk+1, its horrible for this kind of thing. to do what you want, i
> had to (a) write gtk_paned_get_position(), since gtk+1.2 didn't
> provide it and (b) connect to the size_allocate event for the
> paned. there, i would check that the allocation was larger than the
> desired position, and if so, would set the position. then i would have
> to flag that i had done this for that pane, because if you do it again
> later, you get into an endless feedback loop of size_allocate() events
> induced by the set_position() call. in the end, it all works
> nicely. in gtk+1.2 at least, if you attempt to set the position when
> the allocation is too small, the position is clamped to the current

I don't think any of this is relevant here. See my response to you last
week.

Regards,
                                       Owen





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