Guy Harris wrote:
On Feb 5, 2004, at 5:42 AM, Ulf Lamping wrote:
Although we have a common function for creating a scrolled window,
named scrolled_window_new() in gtk/ui_util.c, sometimes this function
is used, and sometimes gtk_scrolled_window_new().
Is this intentional for some reasons I just don't see, or is it only
implemented that way, as the implementors had no idea of using our
common function?
The latter, I suspect.
That was also my idea.
I tend to replace all appearances of gtk_scrolled_window_new() by
scrolled_window_new().
Sounds reasonable.
I will change that.
a) make the preference setting "Vertical scrollbar placement" take
effect for every scrolled window, not only the ones where currently
our function is used.
So is there some GTK+ or GNOME preference to let users select where
they want their scrollbars (in which case we should honor it - if it's
GNOME, presumably we'd do so only if GNOME is being used), or is that
purely left up to the application?
This setting is in "our" Preferences dialog, I don't know if there is
such a one in the common GTK+ / GNOME preferences. What are you thinking
of here exactly?
b) I would like to add a call to
gtk_scrolled_window_set_shadow_type(GTK_SHADOW_IN) for GTK2, as this
will make the scrolled windows look like in the GTK1 versions (and
identical to the GTK2 text entries for example, too).
So is GTK_SHADOW_IN the "typical" scrollbar style for GTK+ 2.x
applications?
The default for GTK2 seems to be GTK_SHADOW_NONE, which is looking
rather sad (at least on win32). I would tend to use the GTK_SHADOW_IN
for this, but we could use a preference setting when someone else will
disagree with this.
c) we could also put a call to
gtk_scrolled_window_set_policy(GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC) to the function in ui_util.c, so typically
scrollbars are only shown when they are needed, meaning when the
window is too small.
And then have only those places that don't want automatic scrollbars
request an alternate policy?
Exact. We could set this AUTOMATIC as "default" inthe common function,
and overwrite this setting at the calling place if it makes sense to do so.
There are some places where GTK_POLICY_ALWAYS is used, but I couldn't
see a reason why. Maybe that was also an implementors intuition
descision, same as not using our common function.
Regards, ULFL