On Saturday, August 23, 2008 9:09 PM, *I* wrote;
> I'm very new to Script-Fu,and I need some advice. One of the biggest
> shortcomings I've found to the existing button scripts is that you
> can only produce buttons for one label at a time. I would like to
> write a script that inputs a group of label strings and creates
> identically sized buttons that are all large enough to contain the
> longest label. (This would make them suitable for vertical webpage
> navbars.) For this I need two things:
Arrgh!!! I did it *again*! You know, if I keep asking questions on this list
only to come up with the answers before anyone here can reply, I'm going to
have to start keeping an eye out for the folks in the white coats. (Not that
I don't already *DO* that, but still.... ;)) Anyway, I found these answers
in the documentation section of Kevin Cozen's Tiny-Fu website at
http://www.ve3syb.ca/software/gimp/tiny-fu.html . (Yes I know, technically
Tiny-Fu isn't the same thing as GIMP v2.4.x Script-Fu under TinySheme, but
it's the best Script-Fu documentation I've found so far.)
> 1.) A "widget" that lets me input a list of strings (preferably as
> lines in a text-box, but I'd accept input from a single-line field
> that was split up by a predetermined delimiter character) that
> returns a string value.
SF-TEXT (see
http://www.ve3syb.ca/wiki/doku.php?id=software:sf:reg-block-args#sf-text for
details).
> 2.) A way to split up the single string into a list of substrings
> using a separator character (newlines for a text-box, some other one
> for a single line input field). Is there an existing function to do
> this?
I found the answer at
http://www.ve3syb.ca/wiki/doku.php?id=software:sf:writing#siod_compatability_routines
in the "items (that) may be useful enough to keep around" list. The
following data comes from the SIOD reference document at
http://www.cs.indiana.edu/scheme-repository/imp/siod.html by George J.
Carrette.
(strbreakup string sep)
Return a list of the portions of string indicated by the separator.
(strbreakup "x=y&z=3" "&") => ("x=y" "z=3")
> Once the label input has been converted to a list of strings, it
> should be fairly simple to determine the largest height and width
> required using gimp-text-get-extents-fontname, and build the button
> images later as per Quintero&Aldama's pupi-button.scm script. Later I
> might add some output options that automatically save the images to a
> specified directory under a prefixed version of the label name, but
> that's quite a way down the road.
I'm still trying to decide whether to start with rounded buttons, or stick
with rectangular beveled ones until I get the label list part of it working.
Does anyone have an image of those translucent rectangular white plastic
"sugar cube" buttons that light up (sometimes in different colors) when
pressed?
--
Dalton "who is *still* looking for that Script-Fu Sensei" Spence