[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?

To create a scrolling TextEdit field. The scroll bar should be created
and handled automatically by the text box.

Or is the Mac OS's toolbox so far behind the Apple IIGS's toolbox that
it can't do that?

> >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 was hoping that I could at least disable those menu items when one of
my windows was in front. Could you show me some example code for this?

-- 
  Kevin Reid.      |         Macintosh.
   "I'm me."       |      Think different.

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