Discussions related to Visual Prolog
brook
Posts: 6
Joined: 5 Mar 2015 12:45

How to start a form when a program run

Unread post by brook »

am doing my thesis on kbs and am using visual prolog 7.5 to develop the prototype KBS.

and i would greatly appreciate if some one explain to me how to start a form when the program run...

I am already used to start form using task window (file new....) but i wanted the form to start when the program run.

main.pro is the first function (predicate) that will run when u execute ur program and it calls the task window. but i want it to call a from..

I think its possible and i would greatly appreciate it if u guys explain this thank u very much in advance

Code: Select all

clauses     run() :-          TaskWindow = taskWindow::new(),         TaskWindow:show().
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

The question is whether you want you program to "be a form" or to be a task window (MDI application) that just have one of it possible forms open to begin with.

It is the first then you should create an SDI application instead of an MDI application.

If you want an MDI application that opens one of its forms, you should do it in exactly the same way as the messageForm is opened in the taskWindow implementation.
Regards Thomas Linder Puls
PDC
brook
Posts: 6
Joined: 5 Mar 2015 12:45

Unread post by brook »

could u please explain with eg the name of the form is, kbs_om.frm and i want it start when the program starts. with out the user has to click anything.

And i already used the mdi i hv no time to change.

Code: Select all

 TaskWindow = taskWindow::new(),         TaskWindow:show(), X =  kbs_os_diagnosis_main_page::new(_),         X:show().
i've used this code and it didnt work new needs some variable (parent).


thank u very much for uir response
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

You didn't answer the question. But I assume that you want to start the form in an MDI application (i.e. with a task window).

In that case you are in the wrong file. You should modify the onShow clause in the taskWindow:

Code: Select all

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


Notice: in the forum form you should not Disable BBCode in this post, and then you should surround code with the [code]...[/code] tags.
Regards Thomas Linder Puls
PDC
brook
Posts: 6
Joined: 5 Mar 2015 12:45

THANKS

Unread post by brook »

i will try it
brook
Posts: 6
Joined: 5 Mar 2015 12:45

Thanks again

Unread post by brook »

than u very much It worked!!!!!!!!!!!
u saved me a lots of reading :-)
And i thought i answered ur question. Ya i used MDI ...

Is the main difference between MDI and SDI the taskwindow?

Regards,
Brook
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

MDI (multiple document interface) have a task window that acts as a workspace for embedded document windows (like the IDE).

SDI (single document interface) is a single window with controls (like a windows explorer).
Regards Thomas Linder Puls
PDC
Post Reply