On Tue, Jan 24, 2012 at 8:24 AM, Axel FILMORE <axel.film...@gmail.com> wrote:
> Hi there,
>
> I'm developing an experimental panel, not something really serious
> currently, just to learn Gtk+ and Vala.
>
> I've done a few things yet, creating an application menu, adding some
> launchers, adding some widgets like, a pager, a window list from libwnck.
>
> I searched into existing panels how things work, read some docs, but
> something I still can't understand is how I can set a fixed size for my
> panel and avoid any widget or container to resize the top level window.
>
> I tried "set_size_request or "size_allocate", for some reasons, only
> "size_allocate" seems to work to resize a libwnck pager, but it doesn't work
> for a Button.
>
> I tried to use a Box, Fixed or Grid container without much success, I
> suspect that I would need to handle some particular signals to do the widget
> layout, but, I just don't know what signal I should handle.
>
> I would like an efficient method to resize any widget or container in order
> that it fits into the top level window and that no widget can resize the top
> level window.

A widget will always receive it's requested minimum width and minimum height.

If that minimum width/height is too big in your opinion, you should then check
how you've constructed those children, make sure that labels ellipsize and
that the font sizes/included icons etc actually fit the sizes you desire.

Bottom line is that the child widget defines how much content must be
shown, under-allocations (below the minimum width and height requests)
are not allowed.

If you want to clip out content of a child widget, then you should put it
into a GtkViewport or and possibly a GtkScrolledWindow.

Cheers,
    -Tristan
_______________________________________________
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