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

widget_control and group_leader



Lets say I have two widgets, A and B. There are two links between the
two:
1) A.top and B.top are eachother's groupleaders, and
2) A uses common blocks and has a variable 'foreign_event_handler' that
is set by B.

So, when an event is generated by A and the 'Use Foreign Event Handler'
option is set in the widget, events generated by A go to whatever B set
'foreign_event_handler' using:

    widget_control, id, event_pro=foreign_event_handler

Things to note:
1) A can't be modified at all. Nothing added or changed. (ie. no more
   variables)
2) B is an object widget and needs to set its structure variables to
   variables in the events generated by A.
3) In B::init, B.top has a uvalue of self.

The question is, how can I use foreign_event_handler to get to 'B self'
from an event generated by A? My thought was:

PRO foreign_event_handler, eventFromA
  widget_control, eventFromA.top, get_Group_Leader = BtopID
  widget_control, BtopID, get_Uvalue = objectReferenceToB
  ...
END

And now I would be in business. But, is there such as thing as
get_group_leader? Is there another way to do this?

I know that not being able to change A doesn't help, else there would be
a million solutions, but its not my program. The only minor change I
might be able to make is to create a generic variable in A's common
block that could be set to whatever, but then I would have to define it
as a string or a long, and that would restrict its use.

Thanks much,


-- Nidhi
-----------------
Nidhi Kalra
nrk5@cornell.edu


Sent via Deja.com
http://www.deja.com/