![]() | ![]()
In order to get ToscaWidgets 2 running on your severs it will be necessary to install various components, including tw2.core, which is obviously essential for enabling the basic features of which applications can then take advantage and tw2.devtools, which allows you to browse widgets and examine the catalogue of pre-formed templates. Depending on your server and interface type there are additional packages prefaced by tw2. to install. In order to start using ToscaWidgets 2 you will first of all need to mock up a basic Web Server Gateway Interface (WSGI) application. The necessary code to perform this function is available online without the need for in-house creation, so you can get started straight away with the widgets. Adding widgets to an existing WSGI application is a simple process that involves finding and editing the necessary code to your specifications and then incorporating it into the necessary fields in order to get the widgets up and running. If performed correctly you should be able to open a web browser after running myapp.py and then visting http://localhost:8000/. Widgets should allow you to create an operational control that is compatible with any HTML browser. The HTML is generated automatically by the widget and you can define the parameters which dictate how the widget will appear on the page in its final form. Widgets can possess both static and dynamic properties, with the former remaining consistent throughout the application`s use, while the latter can change with each new request that is made. As a result it is necessary to generate a new instance for the widget every time a request is made, with substrata of the widget dictating its static properties. In order to modify the way in which a widget appears and operates it will be necessary to add in parameters. Although widgets primarily require coded parameters for the purposes of thorough documentation, some can influence the application in an active manner. The parameters are not set in stone, as a separate widget function can be used to override them, depending on the context and the settings for the default values which have been added. The world of ToscaWidgets 2 goes a lot deeper than it is possible to examine here, although hopefully this brief tutorial has provided an outline as to the possibilities offered by the platform. Whether you are creating widgets that can be viewed on |