$itask challenge
John Boehme
john at integralservices.biz
Fri Nov 9 12:56:58 EST 2018
Hi Kevin,
>From the Studio browser, you can right-click on a window and select the open option, which will open an instance of a window. Just trying to do the same thing. Not really a spurious call.
John Boehme
Integral Consulting Services
Bothell, WA
940-597-3046
-----Original Message-----
From: omnisdev-en [mailto:omnisdev-en-bounces at lists.omnis-dev.com] On Behalf Of Kevin James
Sent: Thursday, November 8, 2018 5:46 PM
To: OmnisDev List - English
Subject: Re: $itask challenge
Hi John
I think I would pretty much always try to set up a method (messaging) in the task of the library I am calling and have that method perform whatever action you want performed.
I don’t like the idea having spurious calls to do do things in an outside library.
If you always restrict access this way (via a controlled messaging protocol) then you will (should) not be caught out by any changes in the target library.
I always image the library belongs to someone else and I have to ask them to provide a method/function with the required parameters and result.
For example, one thing I avoid like the plague is fetching the value of a variable from another library by accessing the variable directly.
FWIW
Cheers
Sent from my iPhone
> On 9 Nov 2018, at 10:25 am, Vik Shah <Vik at Keys2Solutions.com.au> wrote:
>
> Hi John,
>
> Off the top of my head 2 simple tricks comes to mind,
>
> 1. using remote tasks.
> LibA ---> http://127.0.0.1:5192/ultra?OmnisLibrary=myLibB&OmnisClass=rtLauncher¶m1=myWindowClassName ---> LibB[remote task rtLauncher receives the http call] ---> rtLauncher.$construct() > parse the param1 and launch the window class directly or via a timer object.
>
> 2. LibB.StatupTask has a method $launchTimer() that receives a parameter of the window class you want to open and fires a multi-threaded timer object that then launches the window class.
>
> By using the timer object you are making certain that the scope of the instantiation is within the bounds of LibB.
>
> I am sure, given time, there may be other ways of doing this too and my suggestions may be overly complicated but these are what came to my mind when I read your question.
>
>
> HTH
>
>
> Regards,
>
> Vik Shah
> Keys2Solutions
> +61 411 493 495
>
>
>> On 9 Nov 2018, at 10:13, John Boehme <john at integralservices.biz> wrote:
>>
>> Hi All,
>>
>>
>>
>> Here is an interesting little challenge:
>>
>>
>>
>> I have a little library class browser I've been toying with. Has some
>> interesting features plus some future ones to be done. One thing I am
>> trying to do now is, open a window from another library, in the
>> context of the task started by other library.
>>
>>
>>
>> 1) No modifying the target task in any way.
>>
>> 2) No modifying the window in any way.
>>
>>
>>
>> Just want to open a window under the task of the library like the
>> Omnis class browser does.
>>
>>
>>
>> Tried something like this:
>>
>>
>>
>> ***** All these variations and others similar opens the class, but in
>> the task for my browser, not the task for the target application.
>>
>> Do
>> $libs.$findname(IClasses.lib_name).$classes.$findname(IClasses.name).
>> $open(I
>> Classes.name,kWindowNormal)
>>
>>
>>
>>
>>
>> Do
>> $itasks.$sendall(#1.$assign($libs.$findname(IClasses.lib_name).$class
>> es.$fin dname(IClasses.name).$open(IClasses.name,kWindowNormal)),
>>
>>
>> $sendallref.$name=IClasses.lib_name)
>>
>>
>>
>> Do $itasks.$sendall($sendallref.$name.$assign(
>>
>>
>> pick($libs.$findname(IClasses.lib_name).$classes.$findname(IClasses.n
>> ame).$o
>> pen(IClasses.name,kWindowNormal),
>>
>>
>> $sendallref.$name,
>>
>>
>> $sendallref.$name)),
>>
>>
>> $sendallref.$name=IClasses.lib_name)
>>
>>
>>
>> Calculate #S1 as IClasses.lib_name
>>
>> Calculate #S2 as IClasses.name
>>
>> Do
>> $itasks.$sendall(#1.$assign($libs.$findname(#S1).$classes.$findname(#
>> S2).$op
>> en(#S2,kWindowNormal)),$sendallref.$name=#S1)
>>
>>
>>
>>
>>
>>
>>
>> Set the $isIDE flag to true in my browser task, but that didn't
>> change anything.
>>
>> Tried several other variations of this pattern with no success.
>>
>>
>>
>> Any thoughts? Thanks Much.
>>
>>
>>
>> John Boehme
>>
>> Integral Consulting Services
>>
>> Bothell, WA
>>
>> 940-597-3046
>>
>>
>>
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com Start a
>> new message -> mailto:omnisdev-en at lists.omnis-dev.com
>
>
>
>
>
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com Start a
> new message -> mailto:omnisdev-en at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
More information about the omnisdev-en
mailing list