[texworks] SCRIPTS: TW.ui
Paul A Norman
paul.a.norman at gmail.com
Thu May 27 12:12:06 CEST 2010
>> Do the dialogues automatically pass from scope and memory when the
>> script stops, or should I free them in some way? Or is that where the
>> parnet comes in?
>>
>
> Dialogs should not be destroyed automatically when the script ends. In
> fact, I think that at the moment, they are never destroyed (until the
> application terminates or the parent (if any) is destroyed). This is
> something Jonathan should fix - hopefully together with the fact that
> dialogs are shown automatically. Could you post an issue for these two
> issues on GC?
Yep, I have attached a zip with a script that might illustrate the
problem. Any one wnating to see what this is about, put the unzipped
files in a (sub)Script directory.
The .ui was set to modal in Qt Designer, but that behaviour is
currently ignored, and UI show that it is so - the form reports to
script that it si modal, but I use a warning box form script to
display that while the form is still open!
That menas that a Script finishes running, while the dialogue has only
just opened and no user input can be processed by the script at all as
yet, unless i have yet to find how to safely put the script into some
sort of while(){loop} and monitor the situation until the dialogue
form closes? - a virtual modal dialogue?
Another problem is that Qt is not using as many properties as I expected.
Many values of useful things have to be returned by a function call.
However I have no slot to work with, or enabling to call .ui widget's
own Qt functions as yet from script.
( I promised Jonathan if we had dialogues I'd be aiming to do a colour
dialogue!)
In another message (my next one) I have attached a prototype of a
colour dialogue using the x11 colours (at the moment appears to
combine Base Colours, svgnames and x11names, needs some sortng out.
It is based on rgb.txt by the X11 consortium 1994 I think.
There is no .ui - it is all handled internally in the .js
There is much to be done on it - it shows though where I am wanting to take it.
If a colour is hovered over, the mouse toolTip shows the official Colour name.
But when the user selects a colour square (clicks in it), presently I
appear to have no way to obtain the chosen value -- it is not a
property, and although I have obtained a reference to the the widget
in script, I can not execute a function call of the widget, to get the
tableItem and so the toolTip value selected.
Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trialModalDialog.zip
Type: application/zip
Size: 1044 bytes
Desc: not available
URL: <http://tug.org/pipermail/texworks/attachments/20100527/689ab83a/attachment.zip>
More information about the texworks
mailing list