[texworks] HELP: Integrated Tw LaTeX2e Help dialogue
Stefan Löffler
st.loeffler at gmail.com
Wed Jul 7 17:21:07 CEST 2010
Hi,
this is a really great improvement, Paul! Here some more
comments/suggestions:
Am 2010-07-07 05:15, schrieb Ben Harrison:
> 1.
> I had to enable the QtScript debugger in Tw preferences before this
> would run (otherwise I got an error message "ReferenceError: __FILE__
> is not defined"). Is that expected?
This is quite helpful, thanks.
@Paul: No, it should not be necessary to turn on the debugger. If it is
turned on, however, there apparently is some additional debugging
information (like __FILE__) available. I have posted a patch to expose
the filename (and some other data) to scripts in a normal way at
http://code.google.com/p/texworks/issues/detail?id=393, though.
> 3a.
> I searched for \usepackage by highlighting it in my editor, and
> running the menu command. The twin panes opened, then showed four
> choices on the left (usebox, usecounter, usefont, usepackage), and the
> help text for usepackage on the right - nice! I clicked on usepackage
> in the LHS pane, and got an error:
>
> Cannot read file
> "/home/ben/.TeXworks/scripts/Help/html/QVariant(QUrl)":
>
> No such file or directory
>
Strange... this works for me (Ubuntu 10.04 i386, Tw r671). I do have one
question about this, though: why does it only highlight "\use" (and
consequently finds other entries) when I selected "\usepackage"? This
seems counterintuitive to me.
> 3b.
> The error causes the QtScript debugger to open in the background, but
> I can 't do anything to it. If I click on the Help dialogue at this
> point in time, the Help dialogue is focussed, which hides the error
> popup (I didn't realise this at first, just thought it had been
> dismissed).
>
> 3c.
> I can't do anything to the debugger until I cancel the Help dialogue.
> I wouldn't know what to do with it anyway, but just curious if this is
> supposed to be useful?
You're right, you can't work with the debugger in this case. The reason
for this is that the help dialog is modal. This is necessary to avoid
the user closing the calling window (accidentally), which would result
in a crash of Tw once the help dialog is dismissed. So, this is a
peculiarity of modal dialogs that is unavoidable at present.
A few additional points of my own:
* Your recent .zip file contains a file "x.txt". Is this intentional,
or should it be removed?
* When I resize the dialog, the controls resize nicely. However, there
is an increasing border on the left and right margin of the dialog (see
attached screenshot). I believe this can be remedied easily by setting a
non-null value for at least one column in "layoutColumnStretch" of the
layout section of the dialog object in the .ui file. You might also want
to add a horizontal (stretchable) spacer between the buttons so they
don't blow up too much.
* I noticed you set a maximum size of 290 for the LHS panel. Is there a
reason for that? If not, I'd prefer to let the user resize it
arbitrarily. If you just want it to be smaller initially, you could set
"helpBrowser.horizontalSizeStretch" to 1 (this would also make the LHS
stay at the same size when the dialog is resized)
* There still is the problem that an unmodified, untitled (i.e., empty)
window is closed by your getText() routine, resulting in a crash of Tw
when I experimented with your help dialog just after starting Tw
(without generating any content). This should be irrelevant once we get
a real read() function for scripts, but until then I'd recommend to
follow the procedure I outlined previously (only close if "untitled" and
"!modified" are not both true; otherwise simply empty the window again).
HTH
Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texworks/attachments/20100707/f3228a2f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Tw-help-dialog-margins.png
Type: image/png
Size: 38785 bytes
Desc: not available
URL: <http://tug.org/pipermail/texworks/attachments/20100707/f3228a2f/attachment-0001.png>
More information about the texworks
mailing list