[Gambas-user] Creating loadable classes or components

Benoit Minisini gambas at ...1...
Mon Feb 27 17:32:44 CET 2006


On Monday 27 February 2006 01:38, GuruLounge - MailLists wrote:
> I wanted to build a "plug-in" of sorts.  NOT something that I have to
> add to the project then recompile the project.  Just something I could
> drop into the directory, have the main program look for it and use it if
> it's available.  And I want to be able to call it's functions like a
> shared library or DLL.
>
> For lack of a better example -- similar to a Windows DLL but only
> instantiated depending on whether the component happens to exist or
> not... A plug-in... You know, XMMS uses something like this for sound
> effect and visuals.
>
> Anyway, can I do something like that??
>
> Jeff
>

At the moment, you can only make global components and with the development 
version.

Why don't you want to put all your plugins directly inside the project?

There is an not yet documented feature, that allows you to put components in 
"~/.gambas/lib/gambas2". The interpreter will search into this directory if 
it cannot find a component inside the standard directory. Maybe you can put 
your plugins there.

To load a component at run-time, use Components.Load(), with an 's'. You will 
be able to use Component.Load() in the next development version.

Regards,

-- 
Benoit Minisini





More information about the User mailing list