A New Design for the Top Bar?
Moderator: MSandro
Re: A New Design for the Top Bar?
So the run down for this would be Startup.gp->applySettings.gp->(parses JSON file for style)->(sets global variables)->openProjectEditor.gp
Re: A New Design for the Top Bar?
What if an input isn't recognized, for example no input when asking for a colour or a letter when it's supposed to be a number? Would it go to 'nil', 0, some default value that is set by the applySettings.gp, error out and tell the user?
Re: A New Design for the Top Bar?
I qm not sure exactly, but you should set default values if some value is missing
Re: A New Design for the Top Bar?
okok that sounds good,
Have you already tried implementing this or nah?
Have you already tried implementing this or nah?
Re: A New Design for the Top Bar?
I am working on it.
Re: A New Design for the Top Bar?
oo really? Hows it working out for you? I wish i could help more :/
Re: A New Design for the Top Bar?
I have a problem where you could possibly help me: On my GP Settings menu I want to use "(askUser 'set the stage width:' '800') this is the (ask '') block which is available in Sensing. But I am not able to use it in the ProjectEditor for my confStageResolution methonde. If I use "ProjectEditor" instead of "Page" I got a error. But if I use "Page" GP frezes if I call ths method. It also doesn't matter if I use "to" instead of "method".
This also doen't work:
I am not sure what I'm doing wrong
Maybe you will find the solution.
EDIT: I've found the solution, I had to use prompt instead of askUser.
Code: Select all
method confStageResolution Page {
answ = (askUser 'set the stage width:' '800')
}
Code: Select all
method confStageResolution Page {
answ = (call (action 'askUser' 'set the stage width:' '800'))
}
Maybe you will find the solution.
EDIT: I've found the solution, I had to use prompt instead of askUser.
Re: A New Design for the Top Bar?
When you change the resolution of the stage I'm pretty sure it freezes GP and/or it might be because you have to be in Morphic then change the stage height/width then go into the project editor for it to work without errors, although this is just speculation and I'm not 100% positive...
Re: A New Design for the Top Bar?
That is not the problem atm, I know that GP needs to be restarted for the changes to take effect. I currently try to open a text-box to enter the resolution, but I am not able to call "askUser" out of the ProjectEditor. At the moment, I only want the user to be able to enter the width of the stage resolution. I currently trying to create the menu and the graphical interface for the settings. Menus succeed me very well, but I can call a text input.
Here is my ProjectEditor. Search for "//Settings" to find my code.
Here is my ProjectEditor. Search for "//Settings" to find my code.
- Attachments
-
- ProjectEditor.gp
- (25.21 KiB) Downloaded 2152 times
Re: A New Design for the Top Bar?
I'm pretty sure the problem is that you're using 'call'
In place of 'call', try using return
code:
(Maybe take out the first set of parentheses in the code if it doesn't work)
If this still fails then try converting it to a string first then calling it, such as in:
(Again. take out the first set of parentheses in the code if it doesn't work)
In place of 'call', try using return
code:
Code: Select all
to confStageResolution {
answ = (return (action 'askUser' 'set the stage width:' '800'))
}
If this still fails then try converting it to a string first then calling it, such as in:
Code: Select all
to confStageResolution {
answ = (call (toString (askUser 'Set the stage width:' '800')))
}