Larry W. Virden, x2487 wrote:
|
| Has anyone worked on building vtcl components? For instance, say that
| you wanted to create a yes/no dialog box, which was invoked with a
| string to be used as the question. Not a program - but an item that could
| then later be used in programs.
Until now I have only made a few compounds. Some of them require the use
of compound-associated procedure(s).
|
| What steps would you use to create the item? How would you store it so
| that vtcl knew it existed and would display it on the palette?
I would suggest to use the compound mechanism. Create the dialog as a
coumpound (I checked with vtcl-1.10 that coumpounds can be made with
toplevels), then create a compound-associated procedure that is passed the
name of a toplevel and possibly the arguments of the dialog.
This procedure will show the given toplevel, assuming it was built with the
corresponding coumpound, and change the contents of some widgets in it, for
example the text of a message. The binding of the buttons is so that their
toplevel is hidden when pressed. Then the procedure just has to do a
"tkwait window $toplevel" to wait for the user to finish the dialog (and
possibly do a local grab on the window).
There may be another possibility, by considering the given toplevel as
a class and creating a new instance of it, because I guess that the
"Window show" command might be able to do such a thing (I have not tested).
I must recognize that all this is rather heavy, but I didn't experiment
to check it -- yet.
|
| --
| Larry W. Virden INET: [EMAIL PROTECTED]
| <URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
| Unless explicitly stated to the contrary, nothing in this posting should
| be construed as representing my employer's opinions.
--
Hope this helps,
Fabien.
---------------------------------------------------------------------------
To unsubscribe from the Visual Tcl mailing list, please send a message
to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
message body (where [EMAIL PROTECTED] is your e-mail address).