|
DevelopingGravityZooApplications
Prerequisites
IntroductionSo you would like to develop your own GravityZoo cloud application? This document is going to assist you in how to do so with a "Hello World" example. Step By StepStep 1 Download and install the GravityZoo client (http://download.gravityzoo.com/latest) Step 2 Run the installed client application (Double click the following icon on your desktop):
The following (red) icon will appear in your TrayMenu (bottom-right)
Wait a few seconds, and then the icon will turn to orange (which means the client is trying to connect), and then it should turn blue like this: Step 3 The GravityZoo client is now connected. You can rightclick the icon, and a menu will appear. Click “Login”:
After a few seconds, a window will appear:
Click “Create account”. A new window comes up:
Fill out the form to create your account. Make sure your email is real, as you will need it further on. Press “Register” to finish. Your GravityZoo account is now ready. Next step is to create your own FTP-account to upload your sourcecode to. Step 4 Go to http://www.gravityzoo.com/develzoo/ and click on “Register”. Fill out the form that showed up. Click “Ok” to register your account. IMPORTANT: You need to use the SAME email you used to create your GravityZoo account in Step 5 You should have received an email at the Email address you entered under Step 3 and Step 4. Press the confirmation link to activate your account. Step 6 Use an FTP-client (e.g. WinSCP) to connect to: ftp1.develzoo.gravityzoo.com (Port 21, standard port for FTP) Log in with the username and password you’ve created under Step 4 Step 7 The next steps help you creating your first GravityZoo application: Step 7.1 At the root of your FTP-account folder, create a new directory “MyHelloWorld”, and enter that directory. Step 7.2 Whitin that “MyHelloWorld” folder, create a new file, called “ appMain.py ” (Case Sensitive!). This file is the “main” entrypoint for your application. Every GravityZoo application needs an “appMain.py” to be able to run whitin the GravityZoo Cloud OS! Open the file you’ve just created with an IDE or text editor. Copy paste the following sourcecode in there: from gzfUIToolkitClient import gzfUIToolkit
from gzfObject import gzfObject
import repShared
class appStart(gzfObject):
def __init__(self, gzfApp, appArgs={}):
gzfObject.__init__(self, '')
gzfApp.addObject(self)
self._gzfSharingPolicy['methods'] = repShared.LOCAL
self.methods = {}
self.gui = gzfUIToolkit()
self.mainFrame = self.gui.gzfUIWindow()
self.mainFrame.caption = 'Hello World!'
self.mainFrame.size = (300, 200)
self.mainFrame.startPosition = 'CenterScreen'
self.mainFrame.visible = True
self.exampleButton = self.gui.gzfUIButton()
self.exampleButton.text = 'Click Me'
self.exampleButton.dock = 'Fill'
self.exampleButton.visible = True
self.exampleButton.events.add('Click')
self.exampleButton.eventRegistry['Click'] = 'exampleButtonAction'
self.methods['exampleButtonAction'] = self.exampleButtonAction
self.mainFrame.controls.add(self.exampleButton)
def exampleButtonAction(self, sender, args):
self.dialog = self.gui.gzfUIDialog()
self.dialog.showMessageDialog('You have clicked my button!', 'Notification', self.mainFrame, 'Ok', 'Information', 'Button1')Step 7.3 Save the file in your remote directory “MyHelloWorld”. Then wait one minute to be sure your application gets activated whitin the GravityZoo backend. Step 7.4 Right click the blue trayicon, and select “Application Library”:
After a few seconds, a new window will appear:
Select “MyHelloWorld” and click “Run”. Wait a few seconds and cross your fingers... IMPORTANT: You need to be logged in to be able to see your private applications! Step 7.5 After a few seconds, your first GravityZoo application should show up:
Now I know you cannot wait to click that giant button....so go ahead:
That’s it! Congratulations, you’ve just created your first GravityZoo application. In the very near future GravityZoo will provide an online IDE and the possibility to publish your own developed applications in the public GravityZoo Application Library. |
Sign in to add a comment