daa84 wrote:
> daa84 ?????:
>   > I start to write my widget with FlowLayout functionality (with
> > row-breaking). And find next problem:
> > 
> > gtk_widget_size_request function obtains the preferred size of a widget
> > gtk_widget_size_allocate assign a size and position to child widgets
> > 
> > When I fill GtkRequisition structure I send my preferred size of a 
> > widget (width and height). But in size_allocate function I get new width 
> > that smaller then first width value. Than it is need to increase size.
> > How can I do it? Initiate call size_request function another one time or 
> > change GtkAllocation values.
> > 
> > This is only my thoughts, I don't test this in code for now.

Initiate new resizing session and be sure to request smaller size next time
(so that you are not allocated this size again.)  GTK+ is not really suited
for full-scaled negotiation of size.

Adjusting allocation values will not achieve anything since the container
(the one which your flow-layout one is in) will not care.

> I solve this problem using gtk_widget_set_size_request function in 
> allocation function.

This is good as long as the number and size requests of the widgets your
container contains don't change, which is hard to say in advance, especially
the latter part.  Less importantly, this will break if theme/font/etc. is
changed in runtime.

Paul
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to