[g-a-devel]Detecting opening and closure of dialogs using CSPI



Folks,

Using CSPI, Am trying to detect a dialog getting launched or
closed
within an application and this is what I did:

I registered for object:children-changed event and in the
event hook,
tried checking if the event source's parent is NULL:

	/* this code is inside event hook */

	parent = Accessible_getParent (event->source);
      if (!parent)
      {
            /* this is top window */
		...
	}

My understanding is that the main window of the application
emits
children-changed event when a new dialog is launched or
closed.

I would expect that the control would flow into the 'if'
statement
_once_ for launching a new dialog and _once_ for closing it.
But what
happens is the 'if' block gets executed several times for a
single
launch and closure of a dialog (gtk-demo is my application).

Is this the expected behavior ? Or, is this not the way of
detecting
dialogs getting launched or closed ?

Cheers,
Mukund.





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