The RegID's are relative to the form and since self IS the form then 
self.BtnID.getAbsoluteName() should work...at least in the context of 
where you put the print statement (in the Form's afterinit)

Larry Long

On 7/9/2010 8:44 PM, Mike Turchenkov wrote:
>>
>> Try
>> self.btn = dabo.ui.dButton(self,RegID = 'BtnID', Caption="Click Me")
>>
>> Then  "self.Form.BtnID" will allow access to the button obj.
>>
>> Johnf
>>
> Thanks, but it doesn't work for me. only self.btn works. By the way, my
> particular goal is already solved, and only just for clean understanding, I
> wrote simple test script
>
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
>
> import dabo
> app = dabo.dApp()
> dabo.ui.loadUI("wx")
> class my_form_name(dabo.ui.dForm):
>          def afterInit(self):
>                  self.btn = dabo.ui.dButton(self,RegID = 'BtnID',
> Caption="Click Me")
>                  print 'It works from the same def with "self.btn" syntax:',
> self.btn.getAbsoluteName()
>                  #print 'It does not works from the same def with
> "self.Form.BtnID" syntax:', self.Form.BtnID.getAbsoluteName()
>          def onHit_BtnID(self,evt):
>                  dabo.ui.beep()
>                  print 'It works from another def with "self.btn" syntax:',
> self.btn.getAbsoluteName()
>                  #print 'It does not works from another def with
> "self.Form.BtnID" syntax:', self.Form.BtnID.getAbsoluteName()
> app.MainFormClass = my_form_name
> app.start()
>
>
> Here commented prints in afterInit and onHit_BtnID gave error if you
> uncomment them. Is it correct behaviour, or they have to work here?
>
> I'm a newbie in Python, feel free to not respond if my logic is totally
> incorrect ;)
>
>
> --- StripMime Report -- processed MIME parts ---
> multipart/alternative
>    text/plain (text body -- kept)
>    text/html
> ---
> _______________________________________________
> Post Messages to: [email protected]
> Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
> Searchable Archives: http://leafe.com/archives/search/dabo-users
> This message: 
> http://leafe.com/archives/byMID/[email protected]
>


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to