Kirk: The way we did this was to have one picture object on the form for our button palette. When we built the button pallet we created the SVG on the fly and positioned the buttons where we wanted them to go. We did this because we controlled through security what buttons were available for each user, and each user could hide/show the buttons they had available to them. Then they could drag them to where they wanted them within the picture variable on screen. This was all remembered in the USER’s preferences and built at runtime. In compiled mode it was fast, with no noticeable slow down (and that was back in 2012).
I have not looked at that code in years so I cannot be sure, but I expect that using the command Object Get Pointer(Object Named;”xxxx”)-> that it could all be done with local variables. Our new shell does not use any Process Variables. Sometimes it takes a bit of mind bending (at least my old stiff brain) to figure out how to do it. I am getting the hang of it now and really like not using process variables at all. Jody Bevan ARGUS Productions Inc. Developer Argus Productions Inc. <https://www.facebook.com/ArgusProductions/> > On Aug 22, 2017, at 6:12 PM, Kirk Brooks via 4D_Tech <[email protected]> > wrote: > > Keith, > > On Tue, Aug 22, 2017 at 3:54 PM, Keith Culotta via 4D_Tech < > [email protected]> wrote: > >> I think your are right about that. A button is a numeric value. The >> button's picture is an [appendage?] that needs a source. Didn't someone >> come up with a way to "create" variables at runtime? > > > Well, form objects fit the bill. I haven't tried to use a form object with > Object set format (to set the button format and the image) but I have > verified it won't accept local vars or array elements. > > I could simply put the image into a form object picture var but then I've > got two objects for a single button. > > The solution I'm using is to save the svg to files in a folder in > Resources. When loading the button look in the folder for the specific > button image and if it's not there create it and then set the path to that > file for the button. The files are really tiny and I may wind up with a few > dozen of them but that's really no biggie. > > -- > Kirk Brooks > San Francisco, CA > ======================= > ********************************************************************** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

