TreeView instability and fixing an extension

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
tluyben
Posts: 9
Joined: Fri Mar 23, 2018 12:58 am

TreeView instability and fixing an extension

Post by tluyben » Sun Mar 25, 2018 11:56 am

I'm being plagued, all the time, by the 'chunk index out of range' error (which was reported in your bug tracking, but remains unfixed for some reason; seems like a p1 showstopper to me :lol: I literally cannot do anything without getting that error in 8 and 9rc1 ); this doesn't allow me to use the tree view for anything useful at the moment. Nor can you by the way; the Extension Manager, when I go to 'Store' just hangs on producing that same error infinitely.

To I thought I would fix it; I changed treeview.lcb but I cannot get the dev environment to reload that file. How do I let it reload an extension sourcefile in memory so my changes will come into effect?

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: TreeView instability and fixing an extension

Post by bwmilby » Sun Mar 25, 2018 10:58 pm

For reference:
https://quality.livecode.com/show_bug.cgi?id=19753

Since it is part of the app, you will need to compile the widget in a separate directory outside of the app itself.

Do you think you have found/solved the issue? If so I can help getting a PR submitted in it.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

tluyben
Posts: 9
Joined: Fri Mar 23, 2018 12:58 am

Re: TreeView instability and fixing an extension

Post by tluyben » Mon Mar 26, 2018 10:09 am

Excuse my ignorance; I have no clue how to recompile and use extension source code. I know where the file is, I put it outside the project and changed it; how do I open + test it?

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: TreeView instability and fixing an extension

Post by bwmilby » Mon Mar 26, 2018 8:13 pm

I generally work on widgets included in the product from a full source build. I’ll need to pull this out later this evening to work out the full procedure. Essentially you will need a folder with just the one LCB file and supporting resources. Open the Extension Builder (tools menu). Click the folder icon to select the file (top right). Click the play icon to build/test (bottom left). Be sure to change the version number in the LCB file. You may need to rename the widget to test it though.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

tluyben
Posts: 9
Joined: Fri Mar 23, 2018 12:58 am

Re: TreeView instability and fixing an extension

Post by tluyben » Mon Mar 26, 2018 8:57 pm

Thanks a lot! Will test first thing in the morning!

tluyben
Posts: 9
Joined: Fri Mar 23, 2018 12:58 am

Re: TreeView instability and fixing an extension

Post by tluyben » Tue Mar 27, 2018 11:28 am

Ok,

The 'solution' is rather simple;

Code: Select all

        
        // Just return if the click was below all the data
        if mHoverRow < 1 or mHoverRow > the number of elements in mDataList then
                return
        end if
for v8 this is on line 849 and for 9 it's on line 872 .

No more crashes after that, but the extension is still not very nice to use; for some reason, left-clicking on rows some times select them and it's unclear when. When you hold left-mouse on a row it always works and when you right-click shortly it also always works. What you suspect is left click immediate selects and rightclick allows for context menus etc.

Any idea where in the code that is situated?

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: TreeView instability and fixing an extension

Post by bwmilby » Wed Mar 28, 2018 2:19 am

I can see why your fix would avoid the range issue but am still trying to trace the why. I have not been able to trigger the problem so it is hard for me to validate the solution.

The code that handles clicks does not differentiate by button. The selection status of a line should toggle each time it is clicked.

I can’t reproduce the selection issue. What OS and LC versions are you using?
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: TreeView instability and fixing an extension

Post by bwmilby » Thu Mar 29, 2018 5:44 am

PR submitted against develop-9.0
https://github.com/livecode/livecode/pull/6461

Code: Select all

public handler OnClick() returns nothing
	if mHoverRow < 1 then
		put yPosToRowNumber(the y of the mouse position) into mHoverRow
	end if
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

tluyben
Posts: 9
Joined: Fri Mar 23, 2018 12:58 am

Re: TreeView instability and fixing an extension

Post by tluyben » Sat Mar 31, 2018 11:14 am

> I can’t reproduce the selection issue. What OS and LC versions are you using?

Ubuntu 17.04 with

LiveCode Community 8.1.9.x86_64

and

LiveCode Community 9.0.0 rc1 x86_64

The latter is absolutely unusable here to be honest, it makes windows disappear when I click other windows which is seriously making me want to throw my laptop against the wall :)

The issue ofcourse on Linux is not only the distribution but also the windows manager; under i3 it doesn't work at all, Unity and Fluxbox give me the above issues with 9.0.0rc1.

Actually; docking the windows to the background would solve all issues... Is that possible and did I just overlook something, because that would probably also get more people on board as it makes the IDE lose that 80's Smalltalk feel. All applications (and I guess I can move to another part of the forum as I am building app 45 with it today) I make have cards; I absolutely despise windows; it's a cluttered mess while one window and switching cards is excellent. In my opinion (which counts for nothing, I know); the IDE should be like that too, as all IDE's went that way over the past 20 years.

Maybe i'm talking nonsense and it's already possible, but I just have never found out how.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: TreeView instability and fixing an extension

Post by bogs » Sat Mar 31, 2018 4:43 pm

tluyben wrote:
Sat Mar 31, 2018 11:14 am
In my opinion (which counts for nothing, I know); the IDE should be like that too, as all IDE's went that way over the past 20 years.
I wouldn't say your opinion counts for nothing, the sentiment you mention has been brought up more than a few times, although not totally correct. Although the vast majority of IDEs do use the single window/docked layout style, not all do, and some offer both versions.

Lazarus, an IDE for Free Pascal, for instance, offers both SDI and MDI styles to a great extent, just like Delphi did originally. This is my personal favorite style, since it gives the user the option to roll it the way he wants to use it, all in one or out as needed.

As for solutions that might solve your problem as stated, they are not available from the default IDE, but plenty of smart people have resolved it in other ways. The two closest I can think of to what your asking for would be plugins made by Richard and Andy, respectively Devolution and TinyIDE. Devolution worked nicely across all the various window managers/desktops I tested it on and is very minimal, TinyIDE worked pretty well as well and lamps almost all of the dev tools into a bar across the top of your screen.

Hope some of that helps you out.
Image

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: TreeView instability and fixing an extension

Post by bwmilby » Sat Mar 31, 2018 5:13 pm

Can you elaborate on the windows disappearing? I know that if you switch to another app then pallet windows hide, but have not noticed that when switching within the IDE.

On the Linux point... I think there is probably too much emphasis on distribution when the window manager is probably the driver for most display issues that are seen. That is mainly a hunch though. I’ve not tried 17.04 since 16.04 is what is tested against. I will download the next release though to check out the Unity replacement. I don’t do much on Linux but do want to get into it some.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: TreeView instability and fixing an extension

Post by bogs » Sat Mar 31, 2018 8:13 pm

bwmilby wrote:
Sat Mar 31, 2018 5:13 pm
I think there is probably too much emphasis on distribution when the window manager is probably the driver for most display issues that are seen.
In Linux, unlike Windows and Mac, you have a multi fold issue to overcome. One is the WM, as you suspect. The others include the DM, which unlike windows and mac can vary greatly by distro/desktop, and even term confusion, where people lamp the WM, DM, etc together or even interchangeably.

To see some changes for yourself, on your VM play with some of the display managers on that page, you can switch from DM to DM by running

Code: Select all

sudo dpkg-reconfigure lightdm ##or whatever dm you are wanting to test...
Then you have the ongoing various X displays as well. The thing that gets me is, as you well know, I run a variety of the older IDEs across a wide swath of distros and Os structures, that all have these issues to overcome. The older IDEs tend to handle the whole process far more gracefully than the newest versions do. To me, that is just mind boggling.

*Edit - just to elaborate on the DMs, the DMs that Lc tends to run ok/ish on would be lightdm, gdm, and so forth. Then there are ones that produce truly weird effects, like slim (not terrible), nodm, etc.
Image

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: TreeView instability and fixing an extension

Post by jacque » Sun Apr 01, 2018 4:49 pm

The older IDEs tend to handle the whole process far more gracefully than the newest versions do. To me, that is just mind boggling.
Not so much when you know the history. MetaCard, LiveCode's predecessor, was originally written for *nix and the developer worked entirely in that platform. The first port was to Windows, followed later by Mac. When LiveCode acquired the product the focus switched to the most used platforms and support for the *nix flavors was trimmed down to only Linux. Unfortunately support for even that single distribution gets less attention than the others where most of the user base is.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: TreeView instability and fixing an extension

Post by bogs » Sun Apr 01, 2018 9:21 pm

jacque wrote:
Sun Apr 01, 2018 4:49 pm
The older IDEs tend to handle the whole process far more gracefully than the newest versions do. To me, that is just mind boggling.
Not so much when you know the history.
Oh I know, Mc being a special study of mine as you know :wink: I found the interviews written at the time especially enlightening, as well as comments of people using it (or not) posted on the forums based around it. I really loved some of the comments I read that you posted about Mc, I can only imagine sitting there but they sound a lot like my posts :lol:

Come to think of it, that is probably the number 2 reason I like spending so much time in it.
Image

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”