gtk_widget_next()? and gtk_object_enumerate ()?



Hi,

users of my application want to be able to move focus between
GtkEntry's not only via Tab or arrow keys but also with return/
enter key. What is the easiest way to accomplish this?

(1) There should be a function somewhere that determines the 'next'
widget, that receives focus if Tab is pressed. But which function is
that?

(2) If I had such a function I would just wait for the activate sig-
nal on all GtkEntry's. If I get such a signal I would activate (how?)
the next GtkEntry, that is I have to use that function until I get
either a GtkEntry or a GtkButton instance (thus ignoring togglebuttons
and other widgets) and activate that.

Potential problem: each GtkTogglebutton is also a GtkButton but should 
be ignored in this context. Is it possible to find out if a widget is of 
class X but not of any derived class?).

(3) Furthermore, I could save a lot of work if I don't have to change each
window code to connect the activate signal on all entries to a central
function (plus Makefile and includes adjustments). Is it possible to
enumerate all instances of a given class? Equally useful would be to
enumerate all GtkWindow's. The only way that I see now is to register
them manually and store them into a GList upon creation and remove them
on destruction). But that would involve the change of each and every window 
module again.

These enumeration functions would really spare me a lot of work.

Regards,
WL




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