Thanks to your previous answers I have now got a 'working' application 
that displays photos (and their properties) and a map with the locations 
marked.

The map is displayed on a non-sized form and the location of a photo is 
marked with a button at the appropriate point using the following code :

        p_Top,p_Left -(coordinates of button)
        p_Image=  (filename of image (eg 'dscf1234.jpg'))
        b_Caption= (numeric value of image (eg '1234')

        self.btn=dabo.ui.dButton(self, Caption=b_Caption,        
ToolTipText=p_Image, Height=20, Width=40, Top=p_Top, Left=p_Left, 
Transparency=64, ForeColor=(0,0,0), BackColor=(192,256,192),
BorderColor=(128,0,0), BorderStyle=None, FontSize=7)
        
        self.btn.refresh()

this produces the result I want
(see http://www.highersystems.co.uk/misc_stuff.html) displaying up to 
50-100 buttons.
(nb. if the button is placed over another image - the tool tip does not 
display - is this normal behaviour)

I now would like  to do two things :

a. click on any one of these buttons to take further action (eg display 
photo, file name etc.).
        I tried (unsuccessfully) to bind an event to the button :

        #def clickMap(self):
        #       dabo.ui.info(self.Caption)
        #.
        #.
        #self.btn.bindEvent(dabo.dEvents.Hit,clickMap)
        
        .. but I'm not sure how to do it. If I click on a button it takes focus 
(eg. 4804)- changes colour etc. But how to I associate code with this 
button ?


b. How can I reset the image and destroy all the added buttons (apart 
from destroying & rebuilding the form)
        Using the dabo shell I can find the buttons :

                for a in self.Children : print a
                ..
                .
                <dButton50 (baseclass dabo.ui.dButton, id:-1672)>
                <dButton51 (baseclass dabo.ui.dButton, id:-1701)>
                <dButton52 (baseclass dabo.ui.dButton, id:-1714)>
                . etc

        How can I access the properties of each button ?

(I suspect these involve areas of Python programming I haven't grasped 
yet !)

Iain

_______________________________________________
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