Page 1 of 1

How to load a form without a menu

Posted: 16 Sep 2012 13:41
by VPExplorer
Hi,

I'm re-writing an application from another language, in VP. I finished designing the main form, which in the other language is also the main window. There's no menu, doesn't need to be.

The Tyros document explains how to load a form from a menu item. But how do you load a form, automatically, when the application starts?

Posted: 16 Sep 2012 17:05
by Thomas Linder Puls
In the taskWindow implementatio there is a predicate named onCreate. That predicate loads a mesageForm at start-up. You can do exactly the same with your own form.

Re:

Posted: 17 Sep 2012 19:20
by VPExplorer
Great, thanks Thomas.
Thomas Linder Puls wrote:In the taskWindow implementatio there is a predicate named onCreate. That predicate loads a mesageForm at start-up. You can do exactly the same with your own form.

Re:

Posted: 17 Sep 2012 20:21
by VPExplorer
Thomas, I've searched around for a TaskWindow implementation, and cannot find any such project.

Also searched through the example projects for instances of the use of onCreate, and tried different variations in the TaskWindow.pro for my specific project, but continue to get syntax errors.

If the form is called frmMyForm, can you show an example of a fact, predicate, and clause, which would activate and display frmMyForm?


Thomas Linder Puls wrote:In the taskWindow implementatio there is a predicate named onCreate. That predicate loads a mesageForm at start-up. You can do exactly the same with your own form.

Posted: 18 Sep 2012 8:19
by dominique f pannier
Thomas,
It is not the onShow predicate ?

Posted: 18 Sep 2012 10:36
by Tonton Luc
Hi,
A simple exemple :

Code: Select all

predicates     onShow : window::showListener. clauses     onShow(_, _CreationData):-         _MessageForm = messageForm::display(This),         _MyForm = frmMyForm::display(This)         .

Posted: 18 Sep 2012 12:30
by Thomas Linder Puls
Yes, sorry. It is onShow.

Re:

Posted: 18 Sep 2012 15:04
by VPExplorer
That clears it up, ok thanks.

Thomas Linder Puls wrote:Yes, sorry. It is onShow.

Re:

Posted: 18 Sep 2012 15:04
by VPExplorer
Perfect, thanks.
Tonton Luc wrote:Hi,
A simple exemple :

Code: Select all

predicates     onShow : window::showListener. clauses     onShow(_, _CreationData):-         _MessageForm = messageForm::display(This),         _MyForm = frmMyForm::display(This)         .