Gimp script gimpfu2.py

gimpfu2.py es una modificación de gimpfu.py que añade la posibilidad de poner varios elementos en la misma fila indicando la cantidad de columnas que tendrá, esto permite crear interfaces mas compactas al agrupar elementos en filas. Para mostrar varios objetos en la misma fila añadimos un parámetro a la declaración del elemento de interfaz de nuestro script, la declaración con gimpfu.py es:
(PF_OPTION, "anX", "Anchor X:", 1, ("left","center","right")),
Con gimpfu2.py pasaría a ser:
(PF_OPTION, "anX", "Anchor X:", 1, ("left","center","right")
  # añadimos este array:
  ,{'cols':1,'newLine':0}
),
Donde ‘cols’ es la cantidad de columnas que queremos que ocupe y ‘newLine’ será 0 para indicar que el siguiente elemento va en la misma fila o 1 para que pase a una nueva línea. Los scripts que usan scriptfu2 son compatibles con scriptfu. No es necesario añadir {‘cols’:X,’newLine’:X} a todos los elementos, los que no lo incluyan tendrán un valor para ‘cols’ igual a la suma de columnas establecidas en los elementos que si declaran ese valor.

Instalación

Copia este script en el mismo directorio en el que pongas el script que lo use o en cualquiera que se encuentre en la ruta de scripts de Gimp. gimpfu2.py is a modification of gimpfu.py that allows to add multiple items in the same row indicate the number of columns, it helps to create interfaces more compact by grouping elements in rows. To display multiple objects in the same row we add a parameter to the interface element of our script, in gimpfu.py we declare:
(PF_OPTION, "anX", "Anchor X:", 1, ("left","center","right")),
With gimpfu2.py we add:
(PF_OPTION, "anX", "Anchor X:", 1, ("left","center","right")
  # add this array:
  ,{'cols':1,'newLine':0}
),
Where ‘cols’ is the number of columns you want to occupy and ‘newLine’ is 0 to indicate that the next item is on the same row or 1 to create a new row. The scripts using scriptfu2 are compatible with scriptfu, the extra array is ignored. No need to add {‘cols’: X, ‘newLine’:X} to all items, if not declared for an element that element is created in a new row occupying all columns of the table.

Installation Copy this script in the same directory where you put the script you use or whatever is in the path of Gimp scripts.

Descarga/Download

gimpfu2.zip

2 thoughts on “Gimp script gimpfu2.py

  1. If your gui is getting complex enough that it looks like your screenshot of gimpfu2 on the registry, you really should consider using PyGTK directly, to build the GUI yourself. It’s faster and much more flexible. Especially it allows you to do advanced things like pop up subwindows, fold away content inside an Expander, etc.


    • Hi, i know pygtk, the interface of some of my plugins are created directly with pygtk, gimpfu2 is only a actualization of gimpfu that adds the posibility of get more tan one gtk object in a row, the screenshot shows the differences of the plugin followpath using gimpfu and gimpfu2, joining related inputs in the same row makes the interface more compact


Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *