[gtkada] generating events for repeatable tests

Stephen Leake stephen_leake at acm.org
Wed Sep 24 03:18:26 CEST 2003


I'm porting a Windex
(http://www.toadmail.com/~ada_wizard/ada/windex.html) application to
GtkAda (finally!).

One of the things I have in Windex is an easy way to artificially
generate mouse and keyboard events, so I can write repeatable tests of
GUI apps. I'm trying to figure out how to do the same thing in GtkAda.

What I've found so far is GDK.Events; I can Allocate an Event, Set_*
various fields, then Put the event on the event queue (and eventually
Free the Event - not clear when).

While that would probably work, there is a note on Put that says
"Better to use Gtk.Signal.Emit_By_Name". However, there is no package
Gtk.Signal. Grepping for Emit_By_Name turns up lots of generic
subprograms in Gtk.Handlers.

1) Has anyone done this?

2) Is GDK.Event the right approach?

3) If so, when should the Event be Free'd?

Thanks for any help,

-- 
-- Stephe




More information about the gtkada mailing list