Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cs.utexas.edu!hellgate.utah.edu!fcom.cc.utah.edu!bioscience.utah.edu!kofoid From: kofoid@bioscience.utah.edu (Eric Kofoid) Newsgroups: comp.sys.mac.hypercard Subject: Re: Can buttons be created on the fly? Message-ID: <1991Jan12.224039.20837@fcom.cc.utah.edu> Date: 12 Jan 91 22:40:39 GMT References: <4413@mindlink.UUCP> Sender: news@fcom.cc.utah.edu Organization: Dept. of Biology, University of Utah Lines: 42 In article <4413@mindlink.UUCP> a347@mindlink.UUCP (John Miller) writes: > > I'd like to create buttons dynamically within a script, but I > > haven't found a way to do this. > > A new button can be created using the command > domenu "New Button" > > The trick is gaining access to this button so that you can set the > name and location. The button is added to the "end of the list." > > -- Create the button > domenu "New Button" > -- Figure out the button number > put the number of buttons into btnNumb > -- Make it look right > set the name of button btnNumb to "Bob" > set the rect of button btnNumb to 10,40,80,60 > set the style of button btnNumb to "shadow" > -- Be sure to go back to browse tool after creating > -- all the buttons > choose browse tool An even simpler solution: domenu "New Button" set name of last btn to "Bob" set rect of last btn to 10,40,80,60 set style of last btn to "shadow" choose browse tool Cheers, Eric. __________________________________________________________________ | Eric Kofoid; Dept. Biology, U. of Utah; SLC, UT 84112 | | (801) 581-3592 | | kofoid@bioscience.utah.edu | | | | -- The University of Utah is blameless for anything I've said -- | |__________________________________________________________________|