Re: Controlling a widget from an other



Paul Davis <paul <at> linuxaudiosystems.com> writes:
> > 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.
> 
> you noted that it doesn't move "like when the treeview has the focus".
> so for this to work the way you want it to, your SendKeys method would
> have to move the focus away from the entry. 

Yep, and move it back to the text field aftewards. Here's the relevant part 
from my Winforms application:

                    list.Focus();
                    SendKeys.SendWait(key);
                    text.Focus();

Is there a GTK equivalent for this?

> i've written "SendKeys"
> in the past, but i always end up finding that there is no actual need
> for it or that it doesn't accomplish what i am actually trying to
> accomplish.

Here there is actual need for it. It's an item selector window which is 
designed this way, so that it can be operated with the absolute minimum number 
of keypresses:

The user types something into the text field. The relevant items are appearing 
in the treeview immediately during typing. The user selects an item with up/
down (without having to press TAB first to move the keyboard focus to the 
treeview) and presses ENTER. Not having to type TAB is important, because if 
the user changes his mind there is no need to put the keyboard focus back to 
the text field manually again. There is no need for explicit focus switching to 
operate the window.

With Winforms I was able to do it using common widgets with the SendKeys 
method. I hope GTK is versatile enough to do the same.





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