A first graphic mode application

A trivial graphic mode application

Let's create a /pliant/myorg/appli2/converter.ui module with:

module "/pliant/graphic/ui/server/api.pli"
ui_path "/myorg/appli2/converter"
  window left
    button "exit"
      url_return
  window main
    title "My first graphic mode application"
    ovar Float inches := undefined
    input "Inches: " inches
    button "compute"
      section_overwrite "result"
        var Float cm := inches*2.54
        text "Centimeters: "+string:cm
    section "result"
      void

There are two possible methods for testing a Pliant graphical application: the command line, or the integrated development environment.
Running and testing a Pliant application relying on Pliant UI for the graphical user interface is a bit more difficult than running a text mode application because we need to start the server, the client and connect both. So recipes provided in the introduction to various Pliant development environments don't apply. Moreover, there are many possible combinations of client side and server side configuration, not even including potential proxies in the middle, so I'll now provide step by step instructions for just two of them:

Testing your application from the command line

You could first test if your application compiles properly though the following command:

pliant module /myorg/appli2/converter.ui

If you get no error message, then your code compiles fine, so you can move to the next step and try to run it.
Note: You might need to type /pliant/binary/pliant-debug1.exe or \pliant\binary\pliant-debug1.exe instead of just pliant. See command line development for details.

The configuration we now choose for testing is to run both the client and the server within a single Pliant process, so that the connection will be both straight forward and secured using Pliant loopback streams.
In order to run your code, you will run FullPliant environment, through starting 'fullpliant' executable. Under Windows, just click 'fullpliant' in the \pliant\ directory, under Linux, type in:

/pliant/fullpliant

then connect to your application through clicking the 'url' button on the right of the screen and filling the 'URL' field that will appear in the top window with:

loopback:/myorg/appli2/converter

and finally press the 'go' button. You should see the 'My first graphic mode application' title application on top of the screen.

Now, the drawback of this solution is that it may be long to start, and even more if you have a not that fast processor in your PC, so I'll now provide two tricks that you can use to speed up things a little bit:

The first one has already been introduced the the command line development introduction and is named precompiling:

pliant 'precompile /binary/ui.dump module /pliant/install/precompile.pli module /pliant/graphic/ui/client/main.pli module /pliant/graphic/ui/server/main.pli' module /pliant/fullpliant/run.pli

The second one will not always work, but is much faster for testing tiny changes in your application: Apply changes to your application, then just select 'Tools' 'Development' 'Recompile' from FullPliant home menu. If you get no error reported at the top of the screen, then you can move back to your application URL to test the new code without restarting the all Pliant process.
Please keep in mind that Pliant UI client allows you to open up to 11 sessions at once, so you could use one for editing your files, one to get access to the 'Recompile' button, and a third one to test your code. In such a case, you will just use 'url' button in the right window, then 'reload' in the top window to force your third session to switch to the new version of your application.

Testing your application from the integrated development environment

Here, we assume that you already created a logical computer named 'mydevel.mydomain.org' as described in the introduction to the integrated development environment.

Now, we are going to create a development environment suited for our tiny graphical sample application:
From Fullpliant homepage, select 'Tools' 'Development', then 'Configure' 'Create'. Let's now name the new environment 'appli2' and press the 'create' button in the top window.
Here are some suited values for configuring the new development environment:

First, in 'General parameters' section:
Label: appli2
Title: A first graphic mode application

Remarks:

 • 

'Label' is what will be displayed in the select enables you to switch from one development environment to the other.

 • 

'Title' is what will be displayed at the top of the development environment page.

Then in 'Precompile' section:
Dump name: /binary/ui.dump
ID Module
1  /pliant/install/precompile.pli
2  /pliant/graphic/ui/client/main.pli
3  /pliant/graphic/ui/server/main.pli

And in 'Test' section:
ID Module
1  /myorg/appli2/converter.pli

And finaly in 'Links' section:
ID Label         URL
1  Converter  host://mydevel.mydomain.org/myorg/appli2/converter
2  Admin        /pliant/fullpliant/logical
3  Recompile host://mydevel.mydomain.org/pliant/appli/devel/menu

Now, move back to the development environments pages through selecting 'Exit' twice, and select 'appli2' in the select field in the left window.
The title of the main window should switch to 'A first graphic mode application'.

Assuming that your 'mydevel.mydomain.org' logical computer has it's root path set to 'file:/logical/mydevel.mydomain.org/' then the sample application file we created earlier in this document (in the 'A trivial graphic mode application' paragraph) should be in file:/logical/mydevel.mydomain.org/pliant/myorg/appli2/converter.ui

Now, you can test if the sample application compiles fine through using 'test' button at the right side of the '/myorg/appli2/converter.ui' input field.

Then, when you want to run your applicatio, first check that the logical computer is running through
following the 'Admin' link and pressing 'Start' button if needed. The 'Admin' link we have created is just a shortcut to moving back to the Fullpliant homepage and selection 'Configure' then 'Logical and install'

Now, you can test your application through following the 'Converter' link.

If you make some changes in your applications, you have two solutions.
Either follow the 'Admin' link than stop and eventually start for the 'mydevel.mydomain.org' logical computer, then follow the 'Converter' link again,
or follow the 'Recompile' link, then press 'Recompile' button, then 'Exit' then 'Converter' link.
Be careful: there is a 'Recompile' button in your integrated development environment page. It's not the right one to use: you first have to follow the 'Admin' link to switch to the logical computer.

Et voilà !