Re: Controlling a scrolled area....



"Thomas Cameron" <tom ceisystems com> writes:

Okay,

I was rifling through gtkscrolledwindow.c, and I found the scrolled
child function (which is NOT explained in the documentation).  It
appears that you can call 'gtk_scrolled_window_scroll_child', pass it
the wiget you want to scroll, the scroll type, and a boolean value for
"horizontal".

This function is static (not exported), so you can't use is 
it from an app. That's why its not documented.

It's the handler for an action signal. An action signal is
a signal that is emitted in response to a keybinding.

You, could, in theory, do:

 g_signal_emit (scrollwin, "scroll_child", 0, GTK_SCROLL_END, FALSE);

But it is not at all recommended. You should use the adjustments
yourself (see my other mail.)
 
The way it appears to work is as follows:

If you pass:
      GTK_SCROLL_STEP_UP, GTK_SCROLL_STEP_DOWN, GTK_SCROLL_STEP_LEFT,
      GTK_SCROLL_STEP_RIGHT, GTK_SCROLL_PAGE_UP, GTK_SCROLL_PAGE_DOWN,
      GTK_SCROLL_PAGE_LEFT, GTK_SCROLL_PAGE_RIGHT

Then:
      Horizontal is NOT needed (=NULL ?).  The function will decide if
the movement is horiz. or vert.

This is explained in a comment in gtkscrolledwindow.h

  /* Unfortunately, GtkScrollType is deficient in that there is
   * no horizontal/vertical variants for GTK_SCROLL_START/END,
   * so we have to add an additional boolean flag.
   */

Regards,
                                        Owen



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