Gabriel Schulhof nix at
Mon May 28 16:14:02 EDT 2007


On Mon, 2007-05-28 at 03:39 -0500, Richard Laager wrote:
> Gabriel: I know you're on this list... if you have any other changes
> that add public functions, please let me know so we can deal with those
> for 2.1.0 as well.

Well, there's the stuff about adding scrollbars to containers. It
currently looks like this:

 * Places a widget inside a GtkScrolledWindow. The function is defined
as a pass-through so as to be able to
 * accomodate different modifications to a container depending on need.
 * In Hildon's case, its functionality is twofold:
 * 1. It will at least place container inside a GtkScrolledWindow (with
policy set to @c GTK_POLICY_AUTOMATIC)
 *    and return the GtkScrolledWindow.
 * 2. If toplevel is given, then it attempts to deal with the bug
whereby a GtkScrolledWindow
 *    with @c GTK_POLICY_AUTOMATIC, when placed inside a non-resizable
GtkWindow (such as a GtkDialog), tends to
 *    become squashed to its minimum size. This function compensates by
initially setting the policy to
 *    @c GTK_POLICY_NEVER, and overriding the GtkScrolledWindow size
request to include the size of the scrollbars
 *    and viewport borders. Upon showing the GtkScrolledWindow, the
policy is re-set to @c GTK_POLICY_AUTOMATIC.
 *    This will only work on Maemo, because its window manager ensures
that no portion of a dialog is ever shown
 *    off-screen, whereas desktop window managers will give the dialog
all the size it asks for, even if that means
 *    that it won't fit on the screen.
 * @param container The container to make scrollable.
 * @param toplevel  The toplevel widget (non-resizable window or
dialog), or @c NULL
 * @return a GtkScrolledWindow containing a GtkViewport with the widget
passed in.
GtkWidget *pidgin_make_container_scrollable(GtkWidget
*container,GtkWidget *toplevel);
#else /* !USE_HILDON */
# define pidgin_make_container_scollable(container,toplevel) container
#endif /* USE_HILDON */

2 issues related to this:

1. I know you've asked me to come up with a more generic name for a
function that takes a container, modifies it, and spits out a (possible
different) container with the idea that it "prepares" it for being shown
as part of a larger set of widgets. I came up with
"pidgin_prepare_top_container", but it doesn't sound right.

2. This functionality might be too tablet-specific to warrant inclusion
in gtkutils.[ch], and we /did/ discuss the possibility of adding a .[ch]
pair containing functions of the form _pidgin_* (i.e., not public API)
which are tablet-specific. This might be a candidate for such a file.
Unfortunately, this would also mean re-introducing uglyness of the form

gtk_box_pack_start(box, container, TRUE, TRUE, 0);
#else /* !USE_HILDON */
gtk_box_pack_start(box, _pidgin_make_container_scrollable(container,
dialog), TRUE, TRUE, 0);
#endif /* USE_HILDON */

everywhere there's a container full of widgets that needs scrolling on a
tablet, such as every gtkprefs notebook page, new/edit account details,
Add Buddy, Add Chat, plugin preferences, et. al.

Maybe someone can pitch in $0.02's worth of thoughts on how better to
deal with this.



More information about the Devel mailing list