[Gambas-user] Controling Gambas with Gambas

Markus Schatten markus.schatten at ...2005...
Fri Oct 19 01:46:13 CEST 2012


On Fri, Oct 19, 2012 at 1:36 AM, Sebastian Kulesz <sebikul at ...626...> wrote:
> On Thu, Oct 18, 2012 at 8:22 PM, Markus Schatten <markus.schatten at ...2005...> wrote:
>> Dear all,
>>
>> is there a way to execute arbitrary statements dynamically in Gambas
>> (for example from a string)? If I understand correctly Eval only
>> evaluates expressions, but statements like print or function
>> definitions cannot be handled that way. What I would like to do is to
>> provide a scripting interface for my application, e.g. giving users
>> the opportunity to create a macro in gambas, providing it with
>> selected objects from the app (a context) and allow them to directly
>> execute them. Allowing other languages like Python, Ruby, Tcl would be
>> great as well, but I guess this could be done if I could do the first
>> part.
>>
>> Can it be done? Or is there maybe some other way of implementing a
>> scripting interface?
>>
>> All the best,
>>
>> M.
>>
>> --
>> Markus Schatten, PhD
>> Assistant professor
>> University of Zagreb
>> Faculty of Organization and Informatics
>> Pavlinska 2, 42000 Varazdin, Croatia
>> http://www.foi.hr/nastavnici/schatten.markus/index.html
>> http://www.researchgate.net/profile/Markus_Schatten1
>>
>> ------------------------------------------------------------------------------
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://p.sf.net/sfu/appdyn_sfd2d_oct
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
> There was a recent thread on the list about enabling a plugins
> interface for the IDE (or any other Gambas app). With the current
> tools made available to the developer, the DBus component is the
> closest thing to what you are looking for. The "context" could be a
> DBusObject, which any other application can call, either made in
> gambas or not, you only need a DBus interface. See this link [0] for
> an example. The full thread is available here [1].
>
> Another way, but possibly really hard to code for it to be safe, would
> be to use the Component.Load [2] function. This would give the said
> component full access to your app, but maybe that's not what you are
> looking for.
>
> Hope this helps!
>
> [0] http://gambasdoc.org/help/comp/gb.dbus/dbusconnection/register?v3
>
> [1] http://www.mail-archive.com/gambas-user@lists.sourceforge.net/msg20862.html
>
> [2] http://gambasdoc.org/help/comp/gb/component/load?v3
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user

Thanks a lot, the DBus interface is exactly what I was looking for!

All the best,

M.

-- 
Markus Schatten, PhD
Assistant professor
University of Zagreb
Faculty of Organization and Informatics
Pavlinska 2, 42000 Varazdin, Croatia
http://www.foi.hr/nastavnici/schatten.markus/index.html
http://www.researchgate.net/profile/Markus_Schatten1




More information about the User mailing list