Page 1 of 1 1
Topic Options
#85305 - 2002-03-13 07:50 PM KixGUI forms
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
I've playing a lot with KixGUI and have been pretty successful so far. How do I destroy a form?

Form1 has a text box.
Data (Computer Name) is entered into the text box.
Press a button, launch Form2
Form2 run commands based on the data entered
Close form2
Enter new data in form1
Press a button, launch Form2
Form2 still contains data from the original entry?

I have tried a couple of things unsuccessfully... BTW, the form title contains the data entry (computer name)

So how do I destroy form2?

Jim
_________________________
-Jim

...the sort of general malaise that only the genius possess and the insane lament.

Top
#85306 - 2002-03-14 05:53 PM Re: KixGUI forms
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
Not that I'm inot replying to my own posts, but I found a work around for this instance however I still do not know how to destroy a form...
_________________________
-Jim

...the sort of general malaise that only the genius possess and the insane lament.

Top
#85307 - 2002-03-14 08:07 PM Re: KixGUI forms
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
Jim,
you're pointing a specific KiXGUI behavior :
Basically, KiXGUI provide a COM interface between KiXtart (or any language able to use COM) and a physical form and/or control. The bad part with such object is that a COM object exists as long as any variable has a reference to it (this is the way M$ done it)

With that, let's play with it
First, you're creating a form and put it into a variable called $myform. Using $myform, it's possible to do what you want. But now, we are just after the form destruction state: the physical form doesn't exist, the internal reference to this form doesn't exist any more in KiXGUI, but you're still having your $myform variable, now pointing to an inexistant physical form, and until $myform is destructed, the COM object is always here, managing a non-existing form

And so it's the choice i've done : only KiXGUI is able to destruct forms/controls it created, and this only happened when the KiXGUI memory copy is killed (so when your script is finished)
Also, as KiXGUI is able to manage many forms as collection, you can create as many forms as you want without the need to put them in a variable (KiXGUI is already doing that)

Finally, the bad part is that you can't destruct any form, but it's possible to reuse a form with clearing or hidding controls (remember you can also hide/show forms)
And please note that controls are handled in the same way as forms

If this explanation need more light, let me know about, as sometimes i can be darker than London fog [Wink]

[ 14 March 2002, 20:14: Message edited by: Alex.H ]
_________________________
? getobject(Kixtart.org.Signature)

Top
#85308 - 2002-03-15 05:12 PM Re: KixGUI forms
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
I understand your reasoning. My workaround included your suggestions and it's working great!

Thanks!
_________________________
-Jim

...the sort of general malaise that only the genius possess and the insane lament.

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2312 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.056 seconds in which 0.029 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org