Re: Controlling a widget from an other



On Sun, 2006-11-12 at 17:34 +0100, David Nečas (Yeti) wrote:
> On Sun, Nov 12, 2006 at 05:06:25PM +0100, kalap kabat wrote:
> > 
> > - Catch the keypress in the text entry and invoke the 
> > appropriate functions of the treeview for scrolling. This does 
> > not seem viable, since the scrolling functions are not exposed 
> > for the treeview.
> 
> The scrolled window you put the treeview to has signal
> "scroll-child" to scroll the contained widget.  The signal
> is a bit underdocumented, but the GtkScrollType argument
> should be clear and the boolean argument is TRUE for
> horizontal scrolling, FALSE for vertical.

i must note that i find it rather confusing and a little ugly that GTK
allows (and sometimes requires) the use of signals to make things happen
rather than function calls. signals are described primarily (maybe even
exclusively) as notifications that things have happened, and even though
internally, derived widgets connect handlers to parent widget signals to
make things happen, for a user app to emit "scroll-child" rather than
call gtk_scrolled_window_scroll_child() seems ... well, just a bit odd
to me.

--p





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