GIF Reader

Post your nifty GP projects here!

Moderator: MSandro

SimpleSi
Posts: 330
Joined: Jul 2nd, '17, 13:47

Re: GIF Reader

Post by SimpleSi » Oct 28th, '17, 21:44

Since you're starting to write larger GP extensions, let me suggest an alternative work flow
I've read and digested now :)

The class browser technique looks very interesting and I'll give it a go (1st issue I have is that it starts off small and has to be resized and moved - it would be VERY nice if it started off at just less than maximum height of the GP window :) )


I converted to instance vars/methods by doing exactly as you suggested - exporting the class and then modifying it with global search replace (and I wrote a little routine to make sure the instance vars were created as they work differently from shared ones

As you note - it is possible to make syntax errors (and I did) but eventually after a few iterations I sorted them out :)

I'll convert it back it again - I don't want to distract you from doing the big stuff :) and re-upload when done

SimpleSi
Posts: 330
Joined: Jul 2nd, '17, 13:47

Re: GIF Reader

Post by SimpleSi » Oct 29th, '17, 15:19

The idea is to use the "Class Browser" in developer mode to edit one method at a time:
mm - using the class browser is quite different to standard GP editing #eek

When I loaded in your version - I thought - where has all the code gone!

I was just about to make a report when I tried the class browser and found the missing blocks #phew

Then I noticed that none of the variables had a "my" prefix so I thought I'd better stop and have a think before making any more comments!

SimpleSi
Posts: 330
Joined: Jul 2nd, '17, 13:47

Re: GIF Reader

Post by SimpleSi » Oct 29th, '17, 17:55

OK....

So I think that class variables (the ones normally prefixed by "my" are just shown as plain using the class browser which is confusing but I could get maybe get my mind around it :)

But (and a big but) I'm not able to set the value of an existing class/instance variable within the class browser unless it has already been referenced in the method before I opened it

JohnM
Posts: 379
Joined: Sep 11th, '15, 14:42

Re: GIF Reader

Post by JohnM » Nov 8th, '17, 12:03

When I loaded in your version - I thought - where has all the code gone!
As you discovered, then you use the class browser you don't see the methods in the normal scripting pane, but you do see them in the class browser. That's supposed to be helpful, requiring less scrolling to find the method you want to edit, and allowing you to focus on just that method.

However, there are some downsides to writing code in the class browser:
  • As I think you discovered, you can't click on instance variable blocks to see their value.
  • Unlike the normal scripting pane, you can't click on blocks in the class browser (such as "move") to see what they do. The class browser is just code editor, not a place you can tinker. However, you can use the scripting pane for the class as a place to tinker while using the class browser to edit methods.
  • Code snippets lying around in the class browser window that are not part of the method will disappear when you save the method.
So,while the class browser does allow you to work with larger amounts of code in a class, it is not as nice as working in the normal scripting pane. In particular, it doesn't supporter tinkering and exploring nearly as well.

It would be nice to get the scalability of the class browser while continuing to work in the scripting pane. One way to do that might be to allow methods to be collapsed or hidden when you're not actively editing them, thus freeing up space in the scripting pane for the code you're actively working on and blocks you're using for testing and tinkering. Hmm...

Thanks for trying the class browser. Your feedback is providing much food for thought.

Post Reply