[Gambas-user] Sub and Function hijack ?? is this possible ?

olivier coquet ocoquet at 3d-phenomen.fr
Wed Feb 17 21:18:15 CET 2021


Hi Brian, thanks for your suggestions,

For me a plugin is developed later than program, Program can't know what 
plugin will make.
For the folder, I think than the component folder is always known by 
Gambas and a program which run on every version of gambas can always 
find this folder. An absolute path to application can change with user 
configuration.
More, using the component folder permit to create installation package 
with gambas ide as component, we are sure all work perfectly.

regards
Olivier C.

Le 17/02/2021 à 20:53, Brian G a écrit :
>
> See the comments by Ben. I agree that plugins are just components or 
> libraries.
>
> I see no difference. I suspect that each application would have a 
> different need in respect to the plugin. So not sure just how a single 
> framework would work.
>
> It would seem that understanding how it works clearly is enough for 
> other users.
>
> I agree with Ben that the plugins for an application should be in 
> something like /user/share/myapp/plugins/
> This is so the app is not dependent on the gambas structure. It's bad 
> form for an app to be put into the gambas directory and not very portable.
>

> So having the absolute path to the apps plugin collection and then 
> from there doing dir() to see what to load.
>
> --
> My thoughts
> Brian
>
> Wednesday, 17 February 2021, 07:55AM -08:00 from olivier coquet 
> ocoquet at 3d-phenomen.fr <mailto:ocoquet at 3d-phenomen.fr>:
>
>     Hi Brian, thanks a lot for tests and observations....
>
>     It took me some time to understand what you were telling me with
>     _new().
>     I had thought of doing it the way it was originally but it has a
>     major drawback:
>     The _new() procedure runs as soon as I instantiate out I wanted to
>     be able to activate the plugin or not depending on certain states
>     of my main program. So my solution allows to trigger the plugin
>     start at the appropriate time.
>     For the rest (the dir....) totally agreed with you, I hadn't
>     thought about it.
>     Remain to know, do you think it would be useful to create a gambas
>     add-on for this kind of plugin management ????
>
>     friendship
>     Olivier C.
>
>     PS: for French language, deepl is our friend :)
>
>
>     Le 17/02/2021 à 14:03, Brian G a écrit :
>>     Yes I have tried, Cool way to add plugins.
>>
>>     It took me a while to figure out the right way to name the
>>     component..
>>       project name had to be 'myPlugin.plg' or some derivative...
>>       I kept making it MaPlg1 , which it found but crashed because it
>>     was also the component name .. lol
>>
>>     I have attached a text file, as I look at your program.
>>
>>     Suggest to use _new instead of running through all the plugins.
>>     _new is executed upon instantiation of an object. See text file.
>>
>>     and add  Dir(Component.path, "*"&plgid&"*") filter to dir  so you
>>     don't check every file.
>>
>>     lol .. my french is very rusty.. have not really used it since
>>     high school in Canada!
>>
>>     I worked in Quebec for a while.. but still..
>>
>>     Your example Works just fine!
>>
>>
>>     So Yes I tried you program ;)
>>
>>     Brian G
>
>
>     ----[ http://gambaswiki.org/wiki/doc/netiquette
>     <http://gambaswiki.org/wiki/doc/netiquette> ]----
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210217/3ba67ad9/attachment.htm>


More information about the User mailing list