[texworks] SCRIPTS: TW.ui

Paul A Norman paul.a.norman at gmail.com
Wed May 26 02:01:49 CEST 2010

Thanks for that,

I went through the TW.(tree) And could only find Qstring and was not
sure whether it was xml or a file name for ui stuff

Some of this is obvious but I just want to clarifiy / confirmn it to
keep my head clear please.

May be as I get this straight in my mind I should  write it up for others too.

Can we safely (at all times) use null as a parent as in the other dialogues?
Or should I pass somet reference to the current TW.target...?

TW.createUIFromString(uiSpec, parent)
TW.createUI(filename, parent)

The two function calls with out requiring parent(s) are for internal
use only then?


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?

Before script finishes, can the handle of an already created dialogue
be passed to one of the new global objects for later re-use intact?

If that is possible would I need to have created the dialogue with the
application as the parent (TW.app ...), or null?

>> Both functions show the widget they create, and return a handle to it.

Do they open modal and suspend script?

Or can I use the handle, discover widgets -
findChildWidget(QWidget*,QString) and
PRESET certain curent values/script processed stuff, first from script
for the user to interact with in the dialogue?

In  findChildWidget(QWidget*,QString)

QWidget is the handle returmed by createUIFromString() and createUI() ?
and the QTstring is the widget.name being looked for?


On 26 May 2010 03:01, Stefan Löffler <st.loeffler at gmail.com> wrote:
> Hi,
> Am 2010-05-25 15:30, schrieb Paul A Norman:
>> Is TW.ui etc as per
>> http://code.google.com/p/texworks/issues/detail?id=221&q=gui#c13
>> still the correct format please?
> No. Jonathan changed this a bit in the commit. The functions available are:
> TW.createUIFromString(uiSpec, parent)
> TW.createUI(filename, parent)
> where uiSpec is an xml string with Ui data as created by, e.g.,
> QDesigner. Both functions show the widget they create, and return a
> handle to it.
> Stefan

More information about the texworks mailing list