[Apollo-talk] Calling another form from mainform

Back to archive index

ajay sharma ajksh****@myrea*****
Fri Oct 4 15:24:33 JST 2002


Hi,

I am stuck on this.
I have a 'MainForm' which calls a 'LookupForm' to get some value.
For example the mainform has a 'Edit' field and a button.
Clicking this button calls another form, which has some value in a edit
field.
Now when I press a button on this form, this form will close and I will get
this value in the
edit field on the mainform.

<
require 'phi'
include Phi
form = Form.new
btn = Button.new form
txt = Edit.new form
btn.top=100
btn.left=100
txt.top=25
txt.left=25

btn.caption = 'GetValue'
def btn.on_click
  lookupform = Form.new
  lookupform.width=150
  lookupform.height=100
  btn1 = Button.new lookupform
  txt = Edit.new lookupform
txt.text="676"
  btn1.top=35
  btn1.caption = 'SendValue'
<pseudo Delphi code>
    if  lookupform.showmodal=mr_ok then
        mainform.txt=lookupform.txt
</pseudo Delphi code>
end
form.show
Phi.mainloop
>

So in short, I want to create child/lookup forms/dialogs and get values from
them based on the
user input/selection.
Wonder if anybody has any examples which shows how do this properly?
In the btn.on_click event in the above example, how can I access the 'Parent
form'?
I can only access if I declare the form object as
@@form = Form.new
Is this the correct way?




I hope I have explained it clearly.
Regards
Ajay





More information about the Apollo-talk mailing list
Back to archive index