resize dialog with GtkScrolledWindow inside



Hello,


what is the appropriate way to resize a GtkDialog with a
GtkScrolledWindow inside, so the dialog is big enough that the
ScrolledWindow doesn't have to draw the scrollbars (the policy is set to
GTK_POLICY_AUTOMATIC).

Currently i use the following piece of code that works for me:

gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (rt->scrolled),
    GTK_POLICY_NEVER, GTK_POLICY_NEVER);

//wait for all other events
while (gtk_events_pending ()) { gtk_main_iteration (); }

if ((rt->dialog->allocation.width < rt->dialog->requisition.width) ||
    (rt->dialog->allocation.height < rt->dialog->requisition.height))
{
    gtk_window_resize (GTK_WINDOW (rt->dialog),
        rt->dialog->requisition.width, rt->dialog->requisition.height);
}

gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (rt->scrolled),
    GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

Changing the policy each time when doing the resize check doesn't seem
like a good idea to me, but what else can i do?


regards, 

        tooar


-- 
How do we sleep while our beds are burning? - Novaspace




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