Re: Getting the width and height of a widget in gtk+-1.2



Nix wrote:

Hi!

Please CC your reply to my email address, as I am not subscribed. Thanks !

The task is simple enough:  Given any widget, determine its width and
height.  No, gdk_window_get_size doesn't help, because if the widget
does not have its own window, I get the size of one of its containers,
which is useless.

Use gtk_widget_size_request.

My goal is this:
I have a dynamic list(VBox, really) of checkboxes which gets filled in
before the dialog box pops up.  I want to measure the width and height
of the checkboxes, then cause the width of the dialog box to become such
that the scrollwindow and the viewport can accomodate the widest
checkbox without a horizontal scrollbar.  I would like to do this
(preferably) before the dialog box becomes visible, so the user doesn't
experience a jerk when it pops up.

Have you tried setting the horizontal scrollbar policy to GTK_POLICY_NEVER using gtk_scrolled_window_set_policy? Or maybe what you really want is a GtkTreeView list with an editable boolean column?

--
Tim Evans
Applied Research Associates NZ
http://www.aranz.com/




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