« Return to Thread: GnuB needs Script-Fu Sensei

GnuB needs Script-Fu Sensei

by Dalton S. Spence :: Rate this Message:

Reply to Author | View in Thread

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:

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.

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?

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.

--

Dalton "Why re-invent the wheel when you can mass-produce it?" Spence

 « Return to Thread: GnuB needs Script-Fu Sensei