O$: Instance name from Subwindow
Fred Brinkman
fred.brinkman at euromnis.org
Mon Apr 13 18:50:03 EDT 2009
Thanks Christine, Bas,
Turns out I put my question the wrong way around... It should be a bit
to early in the evening to make mistakes like this, but still...
I had the instance ($cinst.$wind().$name) but I needed the class and
not the other way around... must be age.
I have 2 ways to get the name of the class from my subwindow in an
instance of that class, both giving the same result
1) $cinst.$wind.$class().$name
2) $cwind.$class().$name
is there a 'correct' or a 'preferred' one and if yes, why?
Fred
Fred Brinkman
http://www.euromnis.org
**********************************************
Fred Brinkman Consultancy
B-1000 Brussels
Tel. +32-474-83 80 80
Fax +32-2-330 10 31 (on request)
mailto:fred.brinkman at euromnis.org
*********************************************
Op 14 apr 2009, om 00:36 heeft Bastiaan Olij het volgende geschreven:
> Hey Fred,
>
> $cwind() as was mentioned before is the reference to the current
> window,
> so the window itself that is open on which the subwindow resides.
> $cinst
> points to the current instance which when you are running code within,
> which would be your subwindow.
> There is no direct path to the subwindow instance, its not in
> '$iwindows' as it is contained within a window. $cinst().$name within
> the subwindow therefor gives you the name of the subwindow field on
> the
> window which is correct.
>
> But prosuming your subwindow is directly on your parent window, you
> can
> access the subwindow through notation through
> $iwindows.mywindowinstance.$objs.mysubwindowfield
>
> The funny thing is that notation wise, your subwindow instance is
> superimposed ontop of the subwindow field so if the notation can be
> resolved on the subwindow field, that is what you get, but if it can
> not, Omnis then evaluates the notation towards the subwindow instance.
> So $iwindows.mywindowinstance.$objs.mysubwindowfield.$top return the
> $top value of the subwindow field relative to its container but
> $iwindows.mywindowinstance.$objs.mysubwindowfield.$objs.$first().$top
> returns the $top value of the first object within your subwindow
> instance.
>
> You have to be careful where you place such code as you may end up
> using
> your subwindow in other places as well and you do not want to be
> dependent on a fixed notational path that may no longer be valid.
>
> Alternatively you can simply use $cinst().$ref to get an item
> reference
> to your subwindow instance.
>
> Or on your subwindow field on your parent window use the old:
> ----
> $construct
> set reference ivSubWinRef as $cfield().$ref
> ----
> trick.
>
> Finally, you can always examine the outcome of $cinst().$fullname to
> get
> the full notational path in text from within a method in your
> subwindow.
>
> Hope that helps,
>
> Bas
>
> Fred Brinkman wrote:
>> Guys,
>>
>> How do I get the name from the window-itance from within a subwindow
>> in that instance?
>> I tried things like $cinst.$wind().$name and alike but I always get
>> the name of the window class (wMyWIndow), not the instance
>> (wMyWindow_155)
>>
>> I know it's something obvious, but...
>>
>> Thanks
>>
>> Fred
>>
>>
>>
>> Fred Brinkman
>> http://www.euromnis.org
>>
>> **********************************************
>> Fred Brinkman Consultancy
>> B-1000 Brussels
>>
>> Tel. +32-474-83 80 80
>> Fax +32-2-330 10 31 (on request)
>> mailto:fred.brinkman at euromnis.org
>> *********************************************
>>
>>
>>
>>
>>
>>
>>
>>
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com
>>
>
>
> --
> Kindest Regards,
>
> Bastiaan Olij
> e-mail/MSN: bastiaan at basenlily.nl
> web: http://www.basenlily.nl
> Skype: Mux213
> http://www.linkedin.com/in/bastiaanolij
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
More information about the omnisdev-en
mailing list