[Gambas-user] calling back to the caller

Charlie Reinl Karl.Reinl at ...2345...
Fri Mar 19 00:12:51 CET 2010


Am Donnerstag, den 18.03.2010, 21:16 +0100 schrieb Fabien Bodard:
> simplis use a public function
> in the parent form
> 
> Public sub MyFunction
> end
> 
> Then in your component
> 
> Dim o as object
> 
> o = me.parent
> 
> o.MyFunction
> 
> 
> 2010/3/18 Charlie Reinl <Karl.Reinl at ...9...>:
> > Am Donnerstag, den 18.03.2010, 20:12 +0100 schrieb Doriano Blengino:
> >> Charlie Reinl ha scritto:
> >>
> >> >Salut,
> >> >
> >> >is it possible to run from a (gambas2) component, a Sub/Function of the
> >> >component using the 'parent' program?
> >> >
> >> >Something parent.NewsFromMyComponent(TRUE) like I would do with public
> >> >elements on a form: MyForm.NewsFromTheSecondForm(Me.Width)
> >> >
> >> >
> >> >
> >> >
> >> Mmm... it is really not clear what you want to do - anyway, I think you
> >> should use events: they are portable, clean and safe.
> >>
> >> If, instead, you are writing a component which should be aware of other
> >> controls in the same form, or the same parent, without the intervention
> >> of the main program, you can travel the "Parent" property.
> >>
> >> If you really want to peek & poke with fantasy, take a look at the
> >> Object and Class classes (don't remember the exact names). You can
> >> discover all the loaded classes, and invoke any method discovered at
> >> runtime. But it may be a bad idea...
> >>
> >> If this does not help, give more information.
> >>
> >> Regards,
> >> Doriano
> >
> > my project (from now on called 'the program')
> > use a in gambas2 written component (from now on called 'the
> > component' [which is  by it's own, also a executable]).
> > 'the component' is embedded on a form of 'the program'.
> > So the "parent" is known.
> > What I want is calling a Sub/Function, declared in 'the program', out
> > from 'the component' ..... calling back to the caller.
> >
> > Better now ?
> >
> > Charlie
> >

Salut Doriano & Fabian,

I attached a (no, two) gambas2 project(s), which does now, all I
expected to find when I started for that.

Finally what I need is a user "named" Interface which comes back to the
caller which is the users project, who had called my component.
First I planed that the component has to be embedded (for the parents
stuff) but now I found out, I can call back, if the called, knows the
Name of the caller (and the method to call).

That gives me and the user a lot of freedom. 

The reason, why EVAL work with intern method only if you give the name
of the owner (ME.Name) is an extra job for Benoît! 

Amicalement
Charlie


[OperatingSystem]
OperatingSystem=Linux
KernelRelease=2.6.24-27-generic
DistributionVendor=Ubuntu
DistributionRelease="Ubuntu 8.04.4 LTS"

[System]
CPUArchitecture=i686
TotalRam=506932 kB

[Gambas]
Gambas1=gbx-1.0.17
Gambas1Path=/usr/bin/gbx
Gambas2=2.20.1
Gambas2Path=/usr/local/bin/gbx2
Gambas3=2.99.0
Gambas3Path=/usr/local/bin/gbx3    
-------------- next part --------------
A non-text attachment was scrubbed...
Name: callBackProg.tar.bz2
Type: application/x-bzip-compressed-tar
Size: 12106 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20100319/23cead4f/attachment.bin>


More information about the User mailing list