Re: [gtk-list] Re: Setting panes sizes




Hi, 

thanks for the tip, this *almost* work. I'm now able to set up the size
of upper pane ( in the case of an horizontal pane ) programmatically,
but run in some troubles when try to resize the window.
I'm trying to make the upper pane expand or resize when the window
resizes, and make the lower pane remain constant ( or at least, to
conserve the last size that the user resized using the gutter ).

So, i tried to add the following to the window size_allocate event ( to
make a test ). Supposedly, it will try to keep the lower pane with a
height of 200, and although it gets called every time there's a resize,
sometimes either the pane ignores the command, or it resizes in whatever
way it wants ( I think 75% of the times do what I want ). Also, it
depends if I'm resizing the window veritcally or horizontally ( better
results horizontally );

Am I missing something here ? Maybe I should somehow indicate to the
pane that it needs to refresh/redraw somehow ?

Thanks for all the advice

Hugo


--------------------

void
on_window1_size_allocate               (GtkWidget       *widget,
                                        GtkAllocation   *allocation,
                                        gpointer         user_data)
{
    GtkWidget *edit_vpane;

    edit_vpane = get_widget (window1, "edit_vpane");

    g_print( "me resize request widht[%d] height[%d]\n", 
			 allocation->width,
			 allocation->height );

    gtk_paned_set_position( GTK_PANED(edit_vpane), allocation->height -
200 );

}
--------------------



Havoc Pennington wrote:
> 
> Hi,
> 
> I think the function is gtk_paned_set_position(); check gtkpaned.h for
> something similar to that anyway. :-)
> 
> Havoc
> 
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



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