On 11/17/10 9:41 AM, Iain Simpson wrote:
>    I (an elderly retired old fashioned progranmmer - think Cobol !)
> am trying again to use Dabo to build a small application to maintain a
> directory of photos (used as source for updating Open Street Map).
> I'm using using a simple Sqlite database table which
> includes the fields
>       v_filename      - the name of the image
>       v_path          - the folder where the image is held
> as well as GPS data on when&  where the photo was taken.
>
> I've used the PyCon2010 documentation ('Creating a Dabo Application From
> Scratch')
> to create a form to display the data from the table - this works fine
> and I can move up and down quite happily)
>
> At the foot of the form I have a dImage control where I wish to display
> the photo.
> This works OK when I set the Picture property to a test .jpeg and I have
> determined that image can be set in the 'Update' method.
>
> My problem is very, very simple - how to I access the contents of
> earlier text boxes to generate the location of the photo.
>
> Object Info :
> v_filename is in  'dTextBox r0:c1 (dTextBox)'
> v_path in       'dTextBox1 r:3,c1 (dTextBox)'
>
> the code (for dImage)
>
> "def update(self):
>       import os.path
>       x_file=self.Form.dTextBox.Value
>       x_path=self.Form.dTextBox1.Value
>       x_image=os.path.join(x_path,x_file)
>       self.Picture=x_image"
>
> fails with
>       AttributeError: 'dForm_39286' object has no attribute 'dTextBox'
>
> It's a simple problem but I don't think I've grasped how the various
> parts of the app
> ie UI, Bizobj can be accessed (ie bizobj from UI and changing UI seeting
> from Bizobj)

You need a way to reference the textboxes from the Form, which is where RegID 
comes 
in. For each textbox, set the RegID property to something unique, such as 
'txtFile' 
and 'txtPath'. Then your update method could reference them like:

def update(self):
   ...
   x_file = self.Form.txtFile.Value
   ...

Good to see you around here again!

Paul
_______________________________________________
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