All stacks at "birth" are in mode 1 & have weird names ??
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
All stacks at "birth" are in mode 1 & have weird names ??
Hi,
I 'm debugging the code of an interface of OS for blind people for a year and I juste discovered something a bit annoying for me and a bit weird... (at least to me)
While debugging in "step by step" mode, it is possible to check the actual value of variable, by looking in the "variables" tab under the script you are running in the Code Editor stack. Indeed, you'll find an array of the variables in use and their value respec. in the left and right.
When the variable is more than one line, you can't see directly its value but by double-clicking on the variable name in the array, you'll make a new stack appear that displays the value of that variable.
But if you check the mode of this stack, it is in mode... 1 ! and it has a weird name ("stack XXXX", XXXX being a long number). So far I use the mode to keep control of all the stacks are create (< 2 is mine & >1 is from the IDE), so this is quite annoying !
I have to had that I am checking the name & mode of the stacks when their are opening (ie in an openStack function of a "start using" stack)
So, can someone explain me why it is so ? As far as I know, all the other "tool" stacks that LiveCode supplies are in mode > 1. Is it related to the fact that the stack is editable ?
Also, what can I do to distinguish this stack from the one I am creating ?
Thank you for you answers in advance,
G
I 'm debugging the code of an interface of OS for blind people for a year and I juste discovered something a bit annoying for me and a bit weird... (at least to me)
While debugging in "step by step" mode, it is possible to check the actual value of variable, by looking in the "variables" tab under the script you are running in the Code Editor stack. Indeed, you'll find an array of the variables in use and their value respec. in the left and right.
When the variable is more than one line, you can't see directly its value but by double-clicking on the variable name in the array, you'll make a new stack appear that displays the value of that variable.
But if you check the mode of this stack, it is in mode... 1 ! and it has a weird name ("stack XXXX", XXXX being a long number). So far I use the mode to keep control of all the stacks are create (< 2 is mine & >1 is from the IDE), so this is quite annoying !
I have to had that I am checking the name & mode of the stacks when their are opening (ie in an openStack function of a "start using" stack)
So, can someone explain me why it is so ? As far as I know, all the other "tool" stacks that LiveCode supplies are in mode > 1. Is it related to the fact that the stack is editable ?
Also, what can I do to distinguish this stack from the one I am creating ?
Thank you for you answers in advance,
G
Last edited by godot on Wed Aug 05, 2015 11:39 pm, edited 2 times in total.
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Debug Mode and stack creation in weird mode
Window modes are an important part of UI design. Most modern GUIs support different styles, including modal dialogs, modeless dialogs, palettes, and editable documents.
I'm not sure I understand this concern. If you don't want modes other than 1, don't use 'em.
If you have code that gets confused by the presence of stack whose mode may be greater than 1, you can filter them out either by checking their mode, or by filtering for the string "rev" (nearly all IDE stacks, with very few exceptions, have names beginning with "rev").
I'm not sure I understand this concern. If you don't want modes other than 1, don't use 'em.
If you have code that gets confused by the presence of stack whose mode may be greater than 1, you can filter them out either by checking their mode, or by filtering for the string "rev" (nearly all IDE stacks, with very few exceptions, have names beginning with "rev").
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Debug Mode and stack creation in weird mode
Maybe I wasn't clear enough : my problem is not with stacks that have a mode greater than 1 but on the contrary with stacks that are in mode 1.
I am actually doing what you are suggesting me : I filter stacks that are not mine by their mode (<> 1 or 0) as I thought any "rev" stacks had a higher mode than 1
but those stacks (the one that pops out in the "variables" tab of Code Editor) are in mode 1 ! So I can't distinguish them from the one I create.
So my questions are : 1) is it normal for a "tool" stack (the stacks that comes the IDE) to have a mode 1 ?
2) How can you distinguish for sure between my stacks and the other
PS : also, concerning the other kind of filter you are suggesting (by their name), it can't work as I have to deal with stacks during the "openstack" step of their life cycle, so their name is still "untitled" (or named after the template stack).
I am actually doing what you are suggesting me : I filter stacks that are not mine by their mode (<> 1 or 0) as I thought any "rev" stacks had a higher mode than 1
but those stacks (the one that pops out in the "variables" tab of Code Editor) are in mode 1 ! So I can't distinguish them from the one I create.
So my questions are : 1) is it normal for a "tool" stack (the stacks that comes the IDE) to have a mode 1 ?
2) How can you distinguish for sure between my stacks and the other
PS : also, concerning the other kind of filter you are suggesting (by their name), it can't work as I have to deal with stacks during the "openstack" step of their life cycle, so their name is still "untitled" (or named after the template stack).
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Debug Mode and stack creation in weird mode
If I understand correctly, the window you're referring to is the one that pops up when double-clicking a variable value in the bottom pane of the Script Editor, yes?
If so, I just checked that stack and while its title is set to "Value: <nameOfVariableHere>", the stack's name property is "revVariableVisualizer <n>", where "<n>" is the number of such windows that have been opened.
Also, querying the mode of the stack yields 4.
Could there be something in your scripts that changes the mode? Or am I looking at the wrong window?
If so, I just checked that stack and while its title is set to "Value: <nameOfVariableHere>", the stack's name property is "revVariableVisualizer <n>", where "<n>" is the number of such windows that have been opened.
Also, querying the mode of the stack yields 4.
Could there be something in your scripts that changes the mode? Or am I looking at the wrong window?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Debug Mode and stack creation in weird mode
Thanks you so much for your help !
Yes you're looking at the right one ! I partly agree with you for the mode and the name of this stack because when opened they are what you say.
BUT only patly because if you check it during the "openStack" step of their lifecyle (eg in an "openStack" function of a stack that is in "start using" mode), then its name is still "stack XXXXXX" (X being a number) and its mode, 1.
Anyone can check that by :
1) creating a stack named say "myStack"
2) adding a button to it with the following code :
3) writting the following code in the script of a stack "myStack" :
4)then declare the stack as a library via the msg box by this cmd :
5) you click the button
6) you go in the Code Editor (eg via menu "Object" and option "Start Script"
7) In the Code Editor, you open the tab "Variables" and look for varG and click on the magnifying glass icon on the same line at the extreme right of the window
And then you should see what I see :
"stack opening, name : stack "Stack 14324949272" ; mode : 1"
I had time to think about it and I think I understand why... All stack are "at their birth" in mode 1 and have the default name that the template stack give them. Only afterwards, their stack script change their name, mode, etc.
So if I'm right, it means that their is a solution to filter stacks that I don't create :
I have to use the name property of the template stack to give all the stacks that I don't create their first name of my choice...
Sorry for being so long !
G
Yes you're looking at the right one ! I partly agree with you for the mode and the name of this stack because when opened they are what you say.
BUT only patly because if you check it during the "openStack" step of their lifecyle (eg in an "openStack" function of a stack that is in "start using" mode), then its name is still "stack XXXXXX" (X being a number) and its mode, 1.
Anyone can check that by :
1) creating a stack named say "myStack"
2) adding a button to it with the following code :
Code: Select all
on mouseUp
global varG
put "blabla" & return & "blabla" into varG
end mouseUp
3) writting the following code in the script of a stack "myStack" :
Code: Select all
on openStack
if the mode of this stack < 2 then
answer "new stack, name :" && the name of this stack && "; mode :" && the mode of this stack
end if
end openStack
Code: Select all
start using stack "myStack"
6) you go in the Code Editor (eg via menu "Object" and option "Start Script"
7) In the Code Editor, you open the tab "Variables" and look for varG and click on the magnifying glass icon on the same line at the extreme right of the window
And then you should see what I see :
"stack opening, name : stack "Stack 14324949272" ; mode : 1"
I had time to think about it and I think I understand why... All stack are "at their birth" in mode 1 and have the default name that the template stack give them. Only afterwards, their stack script change their name, mode, etc.
So if I'm right, it means that their is a solution to filter stacks that I don't create :
I have to use the name property of the template stack to give all the stacks that I don't create their first name of my choice...
Sorry for being so long !
G
Last edited by godot on Thu Aug 06, 2015 2:34 am, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Debug Mode and stack creation in weird mode
You may be onto something, depending on how the stacks are created. Most of the time I set up the template stack as I want it before creating a new one, but maybe for that window the IDE does what you describe.godot wrote:I had time to think about it and I think I understand why... All stack are "at their birth" in mode 1 and have default name that the template stack give them. Only afterwards, their stack script change their name, mode, etc.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn