It is currently Mon Apr 15, 2024 7:58 am


All times are UTC - 5 hours [ DST ]


Switch to mobile style

Post new topic Reply to topic  [ 70 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars?
PostPosted: Thu Dec 26, 2013 8:42 pm  (#41) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4734
saulgoode wrote:
ofnuts wrote:
If anyone is tweaking this code: the one thing these dialog miss IMHO is some way to set value defaults (and ranges, for sliders/spinners) that are adequate for the image...

That would not be an easy change. The expressions defining the widgets' values are evaluated when the script is loaded, i.e., either at startup or when a Script-fu Refresh is performed, so the image may not be known, let alone its dimensions.


The values are kept between calls to the same filter in the same Gimp session. So Gimp keeps a set of values somewhere which is not the one used in the registration. In fact when one thinks about it the registration is only useful for the menu location, the type of images on which the filter can act, and the PDB declaration. Dialog contents (types of widgets, ranges, defaults values, and labels) being declared at the same time may simplify the code a bit and ease the work of the script developer (this insures some consistency between the dialog and parameters declared to the PDB) but it is not technically necessary and could be done much later.

A possible solution is to keep everything as it is now, and just add a callback function to the registration data. Before displaying the dialog, Gimp passes the dialog description (from the registration or the last use, with values set to the registration defaults or the last ones used) to the callback, which returns a new structure to be used to create the dialog. A default callback just returns the same structure, and advanced call back can change the default values, ranges, labels, available selections... (a PF_HIDDEN widget type could be useful)

_________________
Image


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars?
PostPosted: Sun Dec 29, 2013 4:00 pm  (#42) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
I've taken the first step and setup a development environment in Fedora 20 (running in a VM) and was able to get a clean compile of GIMP 2.9.1 devel from GIT.

Image

Turns out I can compile the Script-Fu plug-in, without doing a full GIMP compile. All I have to do run make in the script-fu folder, making changes to the interface easy to test. :bigthup

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars?
PostPosted: Sat Feb 22, 2014 8:59 am  (#43) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
Well, I've made good progress updating the Script-Fu interface routines to support scrolling. :yes

Image

I still have a few issues to work out, such as auto-sizing, but it works well. :bigthup

This is actually a pretty good solution, due to the fact that existing scripts (ones with lots of input dialogs that don't fit on the screen) won't need to be updated. With the popularity of smaller screen resolution pads and tables, this feature should come in handy, going forward..

I wonder if the GIMP developers would consider adding this code to the next release?

When I've tied up the loose ends, I'll release the finished code for those who like to roll their own GIMP. :hehe

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars (Yes!)
PostPosted: Sat Feb 22, 2014 9:53 am  (#44) 
Offline
GimpChat Member
User avatar

Joined: Jun 02, 2013
Posts: 2075
Nice GT. I liked messing around with the 2.9 version.

_________________
Image


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars (Yes!)
PostPosted: Sat Feb 22, 2014 10:14 am  (#45) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
Well, the development version is pretty dang buggy, at this point. I guess whether any given feature works, depends on when you happen to clone it from GIT and compile. It works well enough for development, though. :hehe

When I'm satisfied the new scrolling code is bug free, I'll release a patch for GIMP's latest stable source code, so we can have scrolling on GIMP V2.8.x (after a compile). Who knows how long before V2.10 is released. My guess is that it won't be soon. ;)

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars (Yes!)
PostPosted: Sat Feb 22, 2014 11:27 am  (#46) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Looking good Tux! :)
This is great news for me as i have a 15.6 monitor but it is also very short I'm gonna guess about 9 inches tall maybe ten so the dialog's are off the screen still for me until this is implemented. So this is just a recompiled src code change for the script-fu.exe file then?

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars (Yes!)
PostPosted: Sat Feb 22, 2014 11:48 am  (#47) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
Rod wrote:
So this is just a recompiled src code change for the script-fu.exe file then?

Yep. The only thing I've had to modify so far is script-fu-interface.c, which is compiles to the script-fu executable (plug-in).

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars (Yes!)
PostPosted: Sat Feb 22, 2014 1:18 pm  (#48) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Earlier in this thread I had proposed using a tabbed dialog as opposed to a scrolling one. While I still think the tabbed approach would present a more elegant interface and be more consistent with the dialogs of other filters, I concede that the scrolling approach implemented by GNUtux would be the more practical implementation.

One of the biggest challenges to creating a tabbed interface would be support for drag-n-drop operations (of brushes, colors, patterns, gradients, etc). By my reckoning, support for this feature would almost double the size of script-fu-interface code, whereas support for drag-n-drop in GNUtux's scrolled dialog should require no specialized processing. Increasing the complexity of the interface code for little, if any, gain in actual functionality can not, in my opinion, be justified.

I look forward to endorsing this feature's incorporation into GIMP. However, I would suggest holding off on submitting an official enhancement request until the code has been tested and its operation can be readily demonstrated and its beneficial nature understood.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars (Yes!)
PostPosted: Sat Feb 22, 2014 5:23 pm  (#49) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
GnuTux Well done, this will make script-fu's more exciting to create and I can't wait to test.
I didn't even realize you were still pursuing development on this wish list idea we were tossing around :bigthup

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars (Yes!)
PostPosted: Sat Feb 22, 2014 7:58 pm  (#50) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
Thanks for the feedback and support for this project.

To be perfectly honest, it's been 15-20 years since I've engaged in any serious C coding and back then, the C language was a bit different than it is today. The basics are the same but I never had to deal with GUIs. The code I was developing back then was mostly hardware interfaces, so my expertise with the abstraction level of the GTK API is pretty much nil.

So, I'm trying to come up to speed. At this point, I'm still at the monkey see, monkey do, level. While my scrolling modifications do work, with the minimal changes I made to the original interface source, I really don't know if what I've done so far is the correct approach, or not. My guess is there are probably more elegant (or proper) ways to code this feature and I would welcome input or collaboration from anyone here. I suppose another resource I could take advantage of would be the GIMP developer list, which I do follow, but I have yet to subscribe to the list.

So far, I've only invested a few hours into this effort and I would like to get a little further along before presenting what I have. Even if I have to toss what I have and start again, the time I've spent has been a good learning experience. That being said, I would like to see this feature implemented in GIMP.

Who knows? The whole idea might be rejected by the GIMP Developers and I'll be the only one using it. :cool

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars (Yes!)
PostPosted: Sat Feb 22, 2014 8:40 pm  (#51) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Monkey see,Monkey do is how i learn anything also i agree Gimp is only interested in their pet GEGL project at the moment.
(so I don't think any response would be forthcoming)
Also i don't understand why this wouldn't affect any previous scripts

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars (Yes!)
PostPosted: Sat Feb 22, 2014 9:08 pm  (#52) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
Graechan wrote:
Also i don't understand why this wouldn't affect any previous scripts

I'm not sure what you mean. The new scrolling interface would be used by all Scheme scripts.

Depending on how tabbed support was implemented, I suppose you could code the interface to split up various input fields into categories or simple columns, which should work on all the older scripts as well.

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars (Yes!)
PostPosted: Sat Feb 22, 2014 9:30 pm  (#53) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Quote:
I'm not sure what you mean. The new scrolling interface would be used by all Scheme scripts.

that was just my mind wandering (it happens) :rofl :rofl

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars (Yes!)
PostPosted: Sun Feb 23, 2014 1:30 am  (#54) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2238
Location: Poland
Thank you for adding new features.
I can not wait to start testing for Windows.

_________________
Image

Slava
Ukraini!


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars (Yes!)
PostPosted: Sun Feb 23, 2014 5:32 am  (#55) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
This implementation should cause all previously installed scripts to incorporate a scroll bar if the interface is too long or the monitor screen too short. I think because all previously installed scripts would not have to be re written to accept the code it is a beautiful step in the right direction. Tux i believe you will make it into the script fu history books. If you need a tester just holler.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars (Yes!)
PostPosted: Sun Feb 23, 2014 6:05 am  (#56) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Rod I think we are all drooling over the possible changes to script-fu scripts this may enable

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars (Yes!)
PostPosted: Sun Feb 23, 2014 10:46 am  (#57) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
Rod wrote:
This implementation should cause all previously installed scripts to incorporate a scroll bar if the interface is too long or the monitor screen too short. I think because all previously installed scripts would not have to be re written to accept the code it is a beautiful step in the right direction. Tux i believe you will make it into the script fu history books. If you need a tester just holler.

Yeah, well, with my weak GTK skills, this project could go down in history ...as an epic fail. :hehe :gaah

The main problem is, I can place the list of Script-Fu input widgets in a resizeable, scrolling box, but it doesn't automatically size the box to initial height & width of the list of input widgets. By default, it sets the width to the size of the action buttons at the bottom and the height to (what appears to be) the minimum size of the vertical scroll bar. So, every time I run a script, I have to manually resize the box, which is a pain. I can manually set the initial size of the box, but since every script's input screen has different widths and heights, setting it manually doesn't really help much.

The behavior we need is as you describe above. I'm sure it can be done, but I can't find any examples and it's not obvious by reading through the docs. :(

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars (Yes!)
PostPosted: Sun Feb 23, 2014 5:44 pm  (#58) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
GnuTux wrote:
Rod wrote:
This implementation should cause all previously installed scripts to incorporate a scroll bar if the interface is too long or the monitor screen too short. I think because all previously installed scripts would not have to be re written to accept the code it is a beautiful step in the right direction. Tux i believe you will make it into the script fu history books. If you need a tester just holler.

Yeah, well, with my weak GTK skills, this project could go down in history ...as an epic fail. :hehe :gaah

The main problem is, I can place the list of Script-Fu input widgets in a resizeable, scrolling box, but it doesn't automatically size the box to initial height & width of the list of input widgets. By default, it sets the width to the size of the action buttons at the bottom and the height to (what appears to be) the minimum size of the vertical scroll bar. So, every time I run a script, I have to manually resize the box, which is a pain. I can manually set the initial size of the box, but since every script's input screen has different widths and heights, setting it manually doesn't really help much.

The behavior we need is as you describe above. I'm sure it can be done, but I can't find any examples and it's not obvious by reading through the docs. :(

Not sure i get you about re sizing each dialog box. Do you mean dragging out the corner of the dialog to make it wider? I don't think the width according to the buttons at the bottom will be an issue. And if i have to scroll in every dialog that is no big deal either. Maybe you could show a screenshot of the problem? Thanks Tux.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars (Yes!)
PostPosted: Sun Feb 23, 2014 7:26 pm  (#59) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
Yes, that what is happening. As it stands now, you have to grab the corner of each script's dialog and drag to expand it, because it always starts at the minimum size. Setting the height to 200px is an OK compromise, I suppose.

Image

Surely, this is an issue than can be resolved and it's just that I haven't figured it out. If I could determine the size of a widget I might be able to just use that. Perhaps saulgoode or someone else here will be able to help out. I did subscribe to the GIMP devel list, so if all else fails, I guess can always ask there. :mrgreen:

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Script-Fu User Entry Screen Scroll-bars (Yes!)
PostPosted: Mon Feb 24, 2014 5:25 am  (#60) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
To me it sounds like you have packing problems

In PyGTK you get to specify if boxes can expand to fill the available space, or just use just enough space to contain their contents. http://www.pygtk.org/docs/pygtk/class-gtkbox.html

In TCL/TK you can specify the horizontal and vertical behaviour separately, so hopefully GTK will allow you something similar.

You do have a conundrum with the vertical size - are you going to create a dialog that is bigger than the user's display, then when they manually re-size it the scroll-bar appears? Or fix the dialog size from the outset? If so what happens to dialogs that are naturally smaller than your fixed size?

Kevin


Top
Post new topic Reply to topic  [ 70 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts scroll bar for gmic exercise

1

No new posts Attachment(s) x=x+1 for Text entry

4

No new posts Attachment(s) Entry point _ZdaPv could not be located

2

No new posts Attachment(s) Missing menu entry for 'Fade Retinex' in 2.10.18

4

No new posts The old the-BRL-box-is-too-big-for-my-screen problem

9



* Login  



Powered by phpBB3 © phpBB Group