feeling guilty ;-) Neat cool icon organizer

Chipp Walters chipp at chipp.com
Wed Oct 19 18:13:22 EDT 2005


Turns out I had a problem with a group on top of itself in the prev 
post. Sorry for wasting bandwidth. So..

Here's a cute script, but first a bit of background.

I typically keep all my icons for buttons in a separate substack. That 
way, I can import them and edit them there, and I don't have to worry 
about making them invisible and keeping track. But, as I keep adding 
more and more icons, the substack gets pretty meesy, so I have button 
"organize icons" with the script:

on mouseUp
   put 0 into tLeftPos
   put 0 into tTopPos
   put 0 into tMaxHeight
   repeat with x = 1 to the number of images on this cd
     put the width of img x into tW
     put max(the height of img x,tMaxHeight) into tMaxHeight
     if tLeftPos + tW > the width of this card then
       add tMaxHeight to tTopPos
       put 0 into tMaxHeight
       put 0 into tLeftPos
     end if
     set the topLeft of img x to tLeftPos,tTopPos
     add tW to tLeftPos
   end repeat
end mouseUp

This lines them up left to right to the width of the card, then starts a 
new row and begins again. I use this in many of my projects. As more 
icons get imported, I can resize the stack window and press the button 
and they're all reorganized for me. Hope someone finds it useful.

best,

Chipp




More information about the use-livecode mailing list