How to load a form without a menu

Discussions related to Visual Prolog
VPExplorer
Posts: 21
Joined: 6 Aug 2012 16:56

How to load a form without a menu

Unread post by VPExplorer » 16 Sep 2012 13:41

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?

User avatar
Thomas Linder Puls
VIP Member
Posts: 1625
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 16 Sep 2012 17:05

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.
Regards Thomas Linder Puls
PDC

VPExplorer
Posts: 21
Joined: 6 Aug 2012 16:56

Re:

Unread post by VPExplorer » 17 Sep 2012 19:20

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.

VPExplorer
Posts: 21
Joined: 6 Aug 2012 16:56

Re:

Unread post by VPExplorer » 17 Sep 2012 20:21

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.

dominique f pannier
VIP Member
Posts: 98
Joined: 23 Sep 2002 23:01

Unread post by dominique f pannier » 18 Sep 2012 8:19

Thomas,
It is not the onShow predicate ?
Regards
Dominique Pannier

User avatar
Tonton Luc
VIP Member
Posts: 501
Joined: 16 Oct 2001 23:01

Unread post by Tonton Luc » 18 Sep 2012 10:36

Hi,
A simple exemple :

Code: Select all

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

User avatar
Thomas Linder Puls
VIP Member
Posts: 1625
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 18 Sep 2012 12:30

Yes, sorry. It is onShow.
Regards Thomas Linder Puls
PDC

VPExplorer
Posts: 21
Joined: 6 Aug 2012 16:56

Re:

Unread post by VPExplorer » 18 Sep 2012 15:04

That clears it up, ok thanks.

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

VPExplorer
Posts: 21
Joined: 6 Aug 2012 16:56

Re:

Unread post by VPExplorer » 18 Sep 2012 15:04

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)         .

Post Reply