Re: How to find the exact size a button is going to get?

varun shrivastava wrote:
you can access GtkAllocation structure which stores the x, y, width and height allocated to a widget
That will (only) give me the size of an existing widget, won't it?

Not what I'm looking for; as I was saying, I want to know what size a widget will have without actually creating it. Or differently put, I'd like to know the "rules" for margins/borders that are drawn around a widget I add to a button.

- Toralf



On Mon, Jun 2, 2008 at 5:13 PM, Toralf Lund <toralf procaptura com <mailto:toralf procaptura com>> wrote:

    For various technical reasons I won't go into right now, one of my Gtk
    apps need to know what size certain buttons it is going to create will
    get, before it actually creates them. Is there any way at all I can
    calculate this? The buttons will contain pixmaps, and I have the image
    data for those, so I actually know the size of the "contents" of the
    buttons, but the total size of a button is somewhat larger as
    (apparently) borders are always added,  so how do I find the size of
    these?  The border associated with the "border-width" property is not
    the one I want, I think, but rather extra borders that magically
    based on the the style or theme or I don't know what.

    Help, anyone?

    - Toralf

    gtk-list mailing list
    gtk-list gnome org <mailto:gtk-list gnome org>

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