Skip to content

Instantly share code, notes, and snippets.

@multimentha
Forked from JacksonBates/ui_examples_1.py
Created July 6, 2016 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save multimentha/d0bf4bec6235a492e4807344a4b4ef3d to your computer and use it in GitHub Desktop.
Save multimentha/d0bf4bec6235a492e4807344a4b4ef3d to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# GIMP UI examples of options
# Feedback welcome: jacksonbates@hotmail.com
from gimpfu import *
def ui_examples_1(int_var, float_var, string_var, value_var, color_var,
colour_var, image_var, layer_var, channel_var, drawable_var,
toggle_var, boolean_var):
return
register(
"python_fu_ui_examples_1",
"Show half of the UI options",
"Dummy UI",
"Jackson Bates",
"Jackson Bates",
"2015",
"Show UI Options...",
"", # Image type
[
(PF_INT, "int_var", "int", 50),
(PF_FLOAT, "float_var", "float", 3.14159),
# I don't know the diference between these PF_INT8, PF_INT16, PF_INT32
# Assuming bitsize, but I'd love to be further enlightened!
(PF_STRING, "string_var", "string", "Awesomesauce!"),
(PF_VALUE, "value_var", "value", "Is this the same as above?!"),
(PF_TEXT, "text_var", "text", "This accepts a longer string of text"),
(PF_COLOR, "color_var", "color", (1.0, 1.0, 1.0)),
(PF_COLOUR, "colour_var", "colour UK sp. :)",(255.0, 255.0, 255.0)),
(PF_IMAGE, "image_var", "image", None),
(PF_LAYER, "layer_var", "layer", None),
(PF_CHANNEL, "channel_var", "channel", None),
(PF_DRAWABLE, "drawable_var", "drawable", None),
(PF_TOGGLE, "toggle_var", "toggle", 1),
(PF_BOOL, "boolean_var", "Boolean", True),
],
[],
ui_examples_1, menu="<Image>/Filters/Languages/Python-Fu" )
main()
#!/usr/bin/env python
# GIMP UI examples of options
# Feedback welcome: jacksonbates@hotmail.com
from gimpfu import *
def ui_examples_2(radio_var, option_var, spinner_var, slider_var,
adjustment_var, file_var, dirname_var, font_var,
brush_var, pattern_var, gradient_var, palette_var):
return
register(
"python_fu_ui_examples_2",
"Show other half of the UI options",
"Dummy UI 2",
"Jackson Bates",
"Jackson Bates",
"2015",
"Show more UI Options...",
"", # Image type
[
(PF_RADIO, "radio_var", "radio", "radio1_value",
(
("radio1_label", "radio1_value"),
("radio2_label", "radio2_value")
)
),
(PF_OPTION, "option_var", "option", 0,
("Opt1", "Opt2", "Opt3", "Opt4")
),
(PF_SPINNER, "spinner_var", "spinner", 10, (1, 10, 0.5)),
(PF_SLIDER, "slider_var", "slider", 100, (0, 100, 1)),
(PF_ADJUSTMENT, "adjustment_var", "adjustment", 10, (1, 10, 1)),
(PF_FILE, "file_var", "file", ""),
(PF_DIRNAME, "dirname_var", "dirname", "/tmp"),
(PF_FONT, "font_var", "font", "Sans"),
(PF_BRUSH, "brush_var", "brush", None),
(PF_PATTERN, "pattern_var", "pattern", None),
(PF_GRADIENT, "gradient_var", "gradient", None),
(PF_PALETTE, "palette_var", "palette", ""),
],
[],
ui_examples_2, menu="<Image>/Filters/Languages/Python-Fu" )
main()
@multimentha
Copy link
Author

multimentha commented Jul 6, 2016

This is Jackson Bates' original script with some minor format issues fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment