Re: question on GtkScrolledWindow



Hi Gregory,

On Fri, 2008-02-01 at 20:31 +0800, Gregory Hosler wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I have 2 questions on GtkScrolledWindow

The 1st.

I want the scroll bar to be "looser". As an example. Suppose I have one item, an icon, in
a horizontally scrollable window. Lets say that the window is 200 pixels across, and the
icon is 10 pixels, with scroll bar "always on" (GTK_POLICY_ALWAYS).

The default visual will be like this:
[snip]
What I want is the ability to move that individual icon from side to side. This means I
want a smalled scrollbar, so that I can scroll the window "off the screen". Something like
this:
[snip]
How might I achieve this ?

I'm not completely sure about your requirements, but I bet you'd better
look the docs about GtkViewport.

You can put into it a broader widget so it can be scrolled "out of the
screen" ... well, it's just scrolled out of the container window ;-)

Check the attachment for an example.

Secondly, How do I control that scrolling programmaticly. i.e. Lets say that then user has
clicked on a button and my response to that click is (among other things), to re-center
the scrolled window (or to center it on a different object).

Which method(s) might I want to be looking at ?

Take a look on GtkScrolledWindow/GtkViewport adjustment (GtkAdjustment).

You must fiddle with its value. Again, check the attached example.

I've looked at the GtkScrolledWindow DevHelp page, and, well, perhaps I'm just not used to
the terms on that page to recognize what I need to look at.

Many thanks in advance.


Hope this helps.

- -Greg Hosler

- ------------------------------------------+

Please also check the log file at "/dev/null" for additional information.
              (from /var/log/Xorg.setup.log)

| Greg Hosler                                 ghosler redhat com    |
+---------------------------------------------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFHoxEZ404fl/0CV/QRAt15AKDkFmYJ0O3r6I43gYCGt8CBERM5pQCgskNM
bti/JRyFsA6JYX5C4khcvQE=
=NtMi
-----END PGP SIGNATURE-----
-- 
Iago Rubio


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