It is currently 19 Feb 2018, 06:00

GIMP/GL QuestionsQuestion about PF_SPINNER (Showcase | Slideshow)

GIMP or GIMP LEARN forum related Questions
Post Reply
No avatar
dfkettle

Forum Member
View: Showcase | Slideshow
Topic Posts: 2/4
Posts: 9
Joined: 13 Jan 2018, 20:17
Cash on hand: 195.99 GLP
Gender: Guy
Location: Toronto, ON, Canada
Website: http://www.cuartooscuro.ca
Operating System: Windows
GIMP Version: 2.8.22
x 1
Canada

Question about PF_SPINNER

Post#1 by dfkettle » 1 week 3 days ago


It appears that PF_SPINNER only allows you to enter integer values, and if you try to enter a real value, it rounds it to the nearest integer (even though the type returned by PF_SPINNER is a float!). Is there some way to enter fractional values in a PF_SPINNER box, or am I forced to use PF_FLOAT instead? I'm running Gimp 2.8.22 under Windows 7 (64-bit).

Thanks.
0 x




Registered members enjoy ads-free content
User avatar
tim
Administrator
View: Showcase | Slideshow
Topic Posts: 2/4
Posts: 2157
Joined: 26 Sep 2016, 00:16
Cash on hand: 7,894.01 GLP
Bank: 51,356.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1196
x 256
Contact:
Canada

Post#2 by tim » 1 week 3 days ago


Yeah enter 0.1 or 0.01 in third parameter to tell it to allow up to whatever decimal points.

like this (PF_SPINNER, "myvar", "My Var:", 20, (1, 1000, 0.1))
0 x



aka Tin
Image gimplearn.net                                              

No avatar
dfkettle

Forum Member
View: Showcase | Slideshow
Topic Posts: 2/4
Posts: 9
Joined: 13 Jan 2018, 20:17
Cash on hand: 195.99 GLP
Gender: Guy
Location: Toronto, ON, Canada
Website: http://www.cuartooscuro.ca
Operating System: Windows
GIMP Version: 2.8.22
x 1
Canada

Post#3 by dfkettle » 1 week 2 days ago


Thanks, it works! Is this documented somewhere? I never would have figured that out.
0 x




User avatar
tim
Administrator
View: Showcase | Slideshow
Topic Posts: 2/4
Posts: 2157
Joined: 26 Sep 2016, 00:16
Cash on hand: 7,894.01 GLP
Bank: 51,356.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1196
x 256
Contact:
Canada

Post#4 by tim » 1 week 2 days ago


I don't think it's documented it just says that its a tuple of (min, max, step). https://www.gimp.org/docs/python/pygimp.html
Nowhere does it say you have to use a decimal as step in order to get real numbers.
I found it out by trying different things.
0 x



aka Tin
Image gimplearn.net                                              

Post Reply

Last 20 Members Who Visited This Topic

User avatar tim (18), BrianStu (1), User avatar leopardo-40 (1), dfkettle (4), User avatar Pat625 (1), User avatar RJKD (1), User avatar gnerd (1)

  • Similar Topics
    Replies
    Views
    Last post
• Featuring Members' Works (Image Attachments Only) •
1: Issabella
2: gnerd
3: dinasset
4: animicule
5: oldmangrumpy
6: Issabella
7: Ella

Who is online

Users browsing this forum: No registered users and 1 guest