The hollywood script test.hws calls up an appropriate test.xml file towards the end of the script via createapp. How would one go about writing a script which, with appropriate radio button choice, calls up a different xml file depending on the choice.
Is that even possible?
Changing xml files
-
- Posts: 475
- Joined: Fri May 15, 2015 5:15 pm
- Location: Waterville, Minnesota USA
Re: Changing xml files
If the child window is called using CreateRequester then yes.
I'm on registered MorphOS using FlowStudio.
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Changing xml files
I'm not sure I fully understand this question but in case you're trying to create additional GUI objects when there is already a GUI, take a look at the Dynamic1.hws example script that comes with RapaGUI. It can open an unlimited number of windows.
Re: Changing xml files
Let me rephrase my question. I have a hollywood script which acts exactly in the same way on one of a number of xml files. However in the actual script I have newr the end to specify the specific xml file which needs to be loaded.
Is there a way of introducing some sort of string variable, before the script is run, which will allow me to load the xml file I want? Someone mentioned child processes, but that just opens new windows or adds new menus or.. ; that is not what I am after.
Is there a way of introducing some sort of string variable, before the script is run, which will allow me to load the xml file I want? Someone mentioned child processes, but that just opens new windows or adds new menus or.. ; that is not what I am after.
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Changing xml files
Hmm, I'm still not sure I understand this question. Of course you can use variables to change the XML file that is loaded, e.g.
Is that what you're looking for?
Code: Select all
Switch a
Case 1:
f$ = "gui1.xml"
Case 2:
f$ = "gui2.xml"
Case 3:
f$ = "gui3.xml"
EndSwitch
moai.CreateApp(FileToString(f$))
Re: Changing xml files
Yes thank you, I know how to do that, includng creating the app as a child process. In other words I can load whatever xml file I want. However the buttons on the loaded xml file seem to be inactive: when pressed they do nothing. I have a feeling it is some problem with my interpretation of msg for the newly loaded xml file. I looked at the dynamic1 example and found it thoroughly confusing, which is entirely my fault. Do I need to include the case of rapaGUI wit msg.action before callng on msg.attribute and how do I embed this among several msg.id ? What is the relevant order of introducing various msg.xxx?
Re: Changing xml files
Are you initializing RapaGUI with InstallEventHandler() after you create your moai.CreateApp()?
Re: Changing xml files
Yes I have placed the InstallEventHandler command towards the end. I have a feeling that I have just not understood the way the messaging goes after i load the child window, which is why the buttons on the child window are inactive. I will have to study your dynamic1 example in more detail I think sinec I have obviously misunderstood something.
Re: Changing xml files
I have got over my problems by simplifying the process. My primary script open a primary xml file where I make a choice of secondary xml file and associated window, closing the primary window in the process. Closing the second window ends the program and this avoids adding and opening extra windows.
I clearly have a lot to learn, but I have learnt enough to achieve my main objective. Thanks to you all for tips.
I clearly have a lot to learn, but I have learnt enough to achieve my main objective. Thanks to you all for tips.