Re: Controlling a widget from an other



David Nečas (Yeti <yeti <at> physics.muni.cz> writes:

> 
> 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 tried this:

     scrolled.emit('scroll-child', gtk.SCROLL_PAGE_FORWARD, False)

and it's scrolling the treeview, but it doesn't move the selection like when 
the treeview has the focus and I press PgDown there. 

I have the feeling it would be much simpler to send a PgDown keypress to the 
treeview somehow. I made a Winforms GUI recently and there it was trivial to 
send keypresses to an other widget using SendKeys. Surely, after all these 
years of development GTK has to have some method to do that.





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