Page 3 of 3

Re: Primary Level Educational version

Posted: Wed Jan 17, 2024 9:50 pm
by OpenXTalkPaul
Setting the defaultStack is needed when you are using commands that act on behalf of the IDE user from scripts in one 'regular' stack editing into another stack. However, a stack in 'palette' mode behaves differently than a stack that is 'topLevel'. A palette mode stack doesn't become the topStack.

There's also other ways to the same sort of things, like using the 'long IDs' to refer to script objects in your copying/importing/etc. scripts.

Re: Primary Level Educational version

Posted: Thu Jan 18, 2024 10:19 am
by richmond62
What is MORE important is that EVERY button on all the palettes need to check for the presence of a stack, as Sunny Jim may be such a 'prawn' that he hasn't, initially, made a stack; and, if Sunny Jim hasn't made a stack flash up something that says something like this:

"You Thumping Great Prawn! You need to make a stack first."

Or, even something that is a bit kinder. 8-)

My "slight problem" is that with a test stack called "Nonsense":

Code: Select all

on mouseUp
   palette "Nonsense"
   put the short name of the topStack into STAKK
   if STAKK is empty then
      put "Utter Cack!"
   else
      put STAKK
   end if
   wait 5 seconds
   topLevel "Nonsense"
end mouseUp
If there is NO topStack it does NOT return 'Utter Cack' to the messageBox: which is NOT good.

Re: Primary Level Educational version

Posted: Thu Jan 18, 2024 11:44 am
by richmond62
Wow: serious distraction! https://www.superchess.nl/indexengels.htm
-
sChess.jpg
sChess.jpg (88.83 KiB) Viewed 2566 times

Re: Primary Level Educational version

Posted: Thu Jan 18, 2024 1:33 pm
by OpenXTalkPaul
richmond62 wrote: Thu Jan 18, 2024 10:19 am If there is NO topStack it does NOT return 'Utter Cack' to the messageBox: which is NOT good.
AFAIK, there is always a topStack, if no other stacks are open then topStack is the revMenuBar stack.

You can get a list of open stacks using 'the stacks' (filenames) or the openStacks (short names), there is also 'the mainStacks' which will list EVERY stack file including all the IDE stacks...
OR you could use the IDE's ideUserMainStacks() that won't include IDE stacks in the list, or revLoadedStacks() which would include any substacks too, and there's also ideMainStacks() which returns mainstacks in memory and takes into account the "Show IDE Stacks" preference.

Re: Primary Level Educational version

Posted: Thu Jan 18, 2024 3:23 pm
by tperry2x
loads of ways of doing the same thing :D

Re: Primary Level Educational version

Posted: Thu Jan 18, 2024 3:26 pm
by FourthWorld
Paul's got it. The topStack is the top-most stack of the lowest mode number. The engine always needs at least one stack open to remain running, so there is always a topStack.

Re: Primary Level Educational version

Posted: Sat Jan 20, 2024 4:17 pm
by tperry2x
richmond62 wrote: Thu Jan 18, 2024 10:19 am If there is NO topStack...
I know this has been discussed already, and what Paul said is 100% right. I just wanted to add:
I was poking around in revIDELibrary and found this nugget:

Code: Select all

/*
Opens an IDE stack as a palette. In the future this should be changed so that
palettes can decide what mode they ought to be opened in, i.e. this logic should
be removed from the IDE library and be specific to the stack rather than the 
palette name.

pPaletteName (String):The readable name of the palette to be opened
example: revIDEOpenPalette "inspector"
*/
So, I was wondering (if that even works, or if it's just something left in as a 'to-do'), if you were to use

Code: Select all

revIDEOpenPalette "newTools"
Will that do what you want with your tools palette, leaving the other stacks selectable?
You'll have to have a play.

Re: Primary Level Educational version

Posted: Sat Jan 20, 2024 4:37 pm
by richmond62
All the subStacks of the newTools stack already open as palettes, as does newTools itself: that was NOT the problem: the problem was that IF there was no stack open the image import routine bunged it into a palette.

This has already been sorted out.

Thanks.

Re: Primary Level Educational version

Posted: Sun Jan 21, 2024 4:13 pm
by richmond62
Tangentially . . . this

https://blogs.kcl.ac.uk/proged/joc/

is quite a good model for anyone wanting to get a 'thing' for Primary children going.

Re: Primary Level Educational version

Posted: Wed Jan 24, 2024 4:09 pm
by richmond62
Much improved image import facility with all sorts of "twiddles":
-
Screenshot 2024-01-24 at 18.08.03.png
Screenshot 2024-01-24 at 18.08.03.png (483.58 KiB) Viewed 2277 times

Re: Primary Level Educational version

Posted: Wed Jan 24, 2024 4:22 pm
by richmond62
Still quite a number of "hiccups" to iron out though.

I am wondering about (like HyperCard) implementing autosave.

I have had far, far too many 9 and 10 year olds in tears because their work went "down the tubes."

Re: Primary Level Educational version

Posted: Thu Jan 25, 2024 1:24 am
by OpenXTalkPaul
richmond62 wrote: Wed Jan 24, 2024 4:22 pm Still quite a number of "hiccups" to iron out though.

I am wondering about (like HyperCard) implementing autosave.

I have had far, far too many 9 and 10 year olds in tears because their work went "down the tubes."
I have an add-on for autosave I picked up somewhere ( from livecodeshare site I think). I'll upload it later so you can take a look at how they set that up. Like everything else I'm sure there's different ways to approach the problem. I've lost work like that but personally I'm more likely to overwrite good scripts with untested bad scripts due to my habit of hitting cmd-S saving often. I sometimes will make a back up (renamed.bak or.old) before I start a scripting session on an existing script, that way I can look back and compare to try to see where changes broke something (Git can do this sort of stuff). I would want an auto-save that makes back up copies when it saves.

Re: Primary Level Educational version

Posted: Thu Jan 25, 2024 9:11 am
by richmond62
At the moment the main problems with my interface are these:

1. A new stack is ALWAYS called 'My Stack', which, apart from the way it makes my guts churn thinking about Windows 95 and 'My Computer', is ludicrous as the thing should be used to produce several stacks that will not interfere with eachother.

2. There is a similar problem with BUTTONS and IMAGES.

#1 & #2 can be easily rectified: it is just very tedious.

3. There needs to be a type of AUTOSAVE implemented: possibly with multiple saves with time-stamps, where all but the last save would be deleted when the IDE is exited.

Should be glad of comments re #3.

Re: Primary Level Educational version

Posted: Sun Jan 28, 2024 8:07 am
by overclockedmind
I find it great to see this. HyperCard was my intro to programming... but if I find the time for it...

I'll be using OXT *and* learning C, C++ probably. I'm tired of not just flat-out being able to say in some language, "DO THIS."

Of course, I also understand I'll be looking at... well a code editor. lol

Can a studious person actually learn C with sufficient willpower and Internet access?