[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Mac::TextEdit and Edit menu crashes



Kevin Reid <kpreid@ibm.net> writes 16 June 1998:

>1. How do I create a scrolling text edit box in a MacWindow?

You don't really tell us enough here.

If you mean scrolling text in a TextEdit field you use TEScroll(DH, DV,
HTE) where DV and DV are the horizontal and vertical increments (in pixels)
and HTE is the TEHandle to the field.

If it is not a TextEdit field then you have to use ScrollRect(RECT, DH, DV,
RGN), which involves substantially more work. With ScrollRect() the pixels
in RECT are moved (DH, DV) leaving an empty space behind. A handle to this
region of space is returned by the function and it is up to the user to
fill the space and dispose of the handle. On the other hand, if you use
TEScroll(), all this is done for you.

Exactly how you use TEScroll() (or ScrollRect() come to that) depends upon
the application. The scroll could be determined by scroll-bars or by some
other means. What are you setting out to do exactly?

>2. When I pick Cut, Copy, or Clear from the Edit menu when a
>script-created window is in front, MacPerl crashes (into MacsBug).
>Ideally, the menu items should instead perform their actions on the
>above-mentioned text edit box.

Yes, this happens too with editable text in 'Dialogs' (which are also based
on TextEdit). It is a difficult problem. All of The MacPerl's MenuBar
refers (I think) to MacPerl's editor. I doubt it would be possible for
procedures to be defined for the MacPerl editor window which would
automatically function in any arbitrary window created by MacPerl.

I think what one has to do is replace the MacPerl Edit Menu (and possibly
others) with an Edit Menu suitably defined for the new window. That is easy
enough to do (see MacPerl Power and Ease) but it is not so easy to ensure
that the right menu-bar is always enabled for the frontmost window.

I have one or two 'excercises' in this sort of 'text moving' area which I
would be happy to share with anyone interested.

Alan Fry



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch