Hi there,
Here is some code that works for me.
/* This is the layer that will be used to display the navigation buttons */
navigationDiv = new DynLayer()
navigationDiv.setSize(618,34)
navigationDiv.setBgColor('navy')
navigationDiv.moveTo(1,249)
this.document.addChild(navigationDiv)
navigationDiv.css.borderWidth="2px"
navigationDiv.css.borderColor="#d4947f"
navigationDiv.css.borderStyle="solid"
navigationDiv.setVisible(false)
btnEditTop = new button(5,4,60,20,"<font
class='buttonText'><center>First<\/center></font>")
btnEditTopGridListener = new EventListener(btnEditTop)
btnEditTopGridListener.onclick=function(e) {editMoveTop(); }
btnEditTop.addEventListener(btnEditTopGridListener)
navigationDiv.addChild(btnEditTop)
// Place previous button
btnEditPrev = new button(65,4,60,20,"<font
class='buttonText'><center>Previous<\/center></font>")
btnEditPrevGridListener = new EventListener(btnEditPrev)
btnEditPrevGridListener.onclick=function(e) {editMovePrevious(); }
btnEditPrev.addEventListener(btnEditPrevGridListener)
navigationDiv.addChild(btnEditPrev)
// Place next button
btnEditNext = new button(125,4,60,20,"<font
class='buttonText'><center>Next<\/center></font>")
btnEditNextGridListener = new EventListener(btnEditNext)
btnEditNextGridListener.onclick=function(e) {editMoveNext(); }
btnEditNext.addEventListener(btnEditNextGridListener)
navigationDiv.addChild(btnEditNext)
// Place last button
btnEditLast = new button(185,4,60,20,"<font
class='buttonText'><center>Last<\/center></font>")
btnEditLastGridListener = new EventListener(btnEditLast)
btnEditLastGridListener.onclick=function(e) {editMoveLast(); }
btnEditLast.addEventListener(btnEditLastGridListener)
navigationDiv.addChild(btnEditLast)
/* This will position the edit record navigation buttons */
btnNewEntry = new button(270,4,80,20,"<font class='buttonText'><center>New
Entry<\/center></font>")
btnNewEntryGridListener = new EventListener(btnNewEntry)
btnNewEntryGridListener.onclick=function(e) {newEntry(); }
btnNewEntry.addEventListener(btnNewEntryGridListener)
navigationDiv.addChild(btnNewEntry)
btnDelete = new button(350,4,80,20,"<font class='buttonText'><center>Delete
Entry<\/center></font>")
btnDeleteGridListener = new EventListener(btnDelete)
btnDeleteGridListener.onclick=function(e) {deleteEntry(); }
btnDelete.addEventListener(btnDeleteGridListener)
navigationDiv.addChild(btnDelete)
btnSave = new button(430,4,80,20,"<font class='buttonText'><center>Save
Changes<\/center></font>")
btnSaveGridListener = new EventListener(btnSave)
btnSaveGridListener.onclick=function(e) {saveChanges(); }
btnSave.addEventListener(btnSaveGridListener)
navigationDiv.addChild(btnSave)
btnGrid = new button(510,4,80,20,"<font class='buttonText'><center>Back to
Grid<\/center></font>")
btnGridGridListener = new EventListener(btnGrid)
btnGridGridListener.onclick=function(e) {showGrid(); }
btnGrid.addEventListener(btnGridGridListener)
navigationDiv.addChild(btnGrid)
Hope this assists.
Max
----- Original Message -----
From: "Peter Curran" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 03, 2001 2:56 AM
Subject: [Dynapi-Help] Dynapi GUI Buttons problem
> I asked about this just before Christmas, but didn't see any response. I'm
> going to try again, in case I missed something, 'cause I'm still stuck.
>
> I am trying to create a simple clickable button, with a text label, that I
> can write event handlers for. This seems like just about the simplest
> interactive widget imaginable, but I can't get it to work. I am using the
> dyapi.gui.button object as the base, but it doesn't work. Clicking on the
> text of the button does not result in an event that triggers the event
handler.
>
> If I put a wide border around the button, and click on the border, events
> happen as I expect. However, clicking directly on the text does not cause
> an event.
>
> I'd easily believe that I am doing something wrong, but the example -
> dynapi.gui.button.html in the examples directory - behaves exactly the
same
> way. In the largest button with a text label in that example, clicking
> directly on the text has no effect; clicking on the border around the
> button causes the button to grow, exactly as it is supposed to.
>
> So what I am doing wrong? Surely this is one of the most basic widgets
> possible. I can't imagine I am the only one who has tried to do this. Is
> there something special I have to do to make it possible to get events
from
> a label?
>
> Thanks for any help anyone can provide.
>
> --
> Peter Curran Software Developer Casebank Technologies Inc.
> [EMAIL PROTECTED]
>
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/mailman/listinfo/dynapi-help
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/dynapi-help