[Gambas-user] Sub and Function hijack ?? is this possible ?
olivier coquet
ocoquet at 3d-phenomen.fr
Mon Feb 15 18:35:31 CET 2021
Hello Brian,
here are tow file in zip format:
- plg_test_fmain is the test src program in gambas, it can run as is.
- plg_test_plugin, must be compiled, generate install packet as
component and install it.
When you run plg_test_fmain without plugin component installed, it have
3 buttons (test1,test2,test3)
when you run with plugin installed, another button (plg1) show, if you
click it, a message show you than this button is managed from plg_test
class, if you click on test2, you see it is managed in fmain, if you
click test1 you see it is managed in plg_test and management of test2 is
now rerouted to plg_test. try it and look at the code.
Regards
Olivier Coquet
Le 15/02/2021 à 17:58, Brian G a écrit :
> Are you adding dynamic classes as plugins? Not sure when this would be
> needed? Or are you defining classes on the fly in you code?
>
> Would be interesting to know how your using it!
>
> It is a simple way of writing once and basically having a sort of self
> modifying code. That is any module or class can change the actual
> destination of a call without the main process knowing about it.
>
>
> Thank You
> Brian G
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210215/a0afbeed/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PLG_Test_fmain.zip
Type: application/zip
Size: 15031 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210215/a0afbeed/attachment-0002.zip>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plg_test_plugin.class.zip
Type: application/zip
Size: 559 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210215/a0afbeed/attachment-0003.zip>
More information about the User
mailing list