• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTextView setRulerVisible: weirdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView setRulerVisible: weirdness


  • Subject: Re: NSTextView setRulerVisible: weirdness
  • From: Todd Ransom <email@hidden>
  • Date: Sun, 12 Jun 2005 14:49:53 -0600

For what it's worth, I see similar behavior with my app under Tiger. The ruler's accessory view will not show unless the user first clicks in the text view. Setting the text view to be first responder on window load fixed the behavior in one instance but not in another.

Todd Ransom
Return Self Software
http://returnself.com



On Jun 12, 2005, at 11:05 AM, Keith Blount wrote:

Hello,

I seem to have fixed this problem, though I'm not
quite sure why. If I call [[textView window]
makeFirstResponder:textView] before calling
-setRulerVisible:, everything works fine, whether I
call -setRulerVisible before or after loading the text
and notes, and there is no delay in showing the ruler.
I'm not quite sure why I have to do this to prevent
such odd behaviour - especially seeing as my custom
view is set to initialFirstResponder in IB, and my
custom view just passes on first responder status to
the text view in -becomeFirstResponder - but at least
things seem to be working without a problem now.

Thanks anyway,
Keith

--- ORIGINAL MESSAGE ---

FROM : Keith Blount
DATE : Sun Jun 12 11:10:19 2005

Hello,

I am seeing some strange effects when calling
setRulerVisible:YES on an NSTextView. My text view is
contained inside a container view that places a margin
view (NSView subclass) on the left of the text view.
The container view works out all resizing so that it
is big enough to contain both the margin and the text
view, and it is the container view that is set as the
document view of the text view.

The margin view just displays notes that are
associated with the text. The notes are stored as a
custom attribute in the text storage
(KBNoteAttributeName associated with a string).

In my document, in windowControllerDidLoadNib:, I
first load the text using readRTFDFromFile: and then I
set up the notes from an array, cycling through the
array and applying note attributes to the text.

If I call setRulerVisible:YES on the text view before
I load the text and apply the notes, everything works
fine, except that the ruler doesn't show any tabs or
the alignment buttons until all the notes have been
applied, so there's a two second pause.

However, if I call setRulerVisible:YES on the text
view *after* loading the text and applying the notes,
my view loads with the ruler visible, but it is not
sized or drawn properly. The text and margin view are
visible, but their container view hasn't done any
resizing or drawing, as though its subviews have
loaded but it hasn't done anything else...

A workaround that works is this:

[textView setRulerVisible:YES];
[textView setRulerVisible:NO];

[self loadTextAndNotes];

[textView setRulerVisible:YES];

By quickly setting the ruler visible and hiding at
again before loading text and notes, then doing the
loading, then setting the ruler visible again,
everything seems to load fine - the ruler is visible
with no pause at the same time as the text and notes.
This seems a very strange thing to have to do, though.

Does anybody have any idea what is going on here?

Many thanks for any help in advance,
Keith

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: NSTextView setRulerVisible: weirdness
      • From: Keith Blount <email@hidden>
References: 
 >RE: NSTextView setRulerVisible: weirdness (From: Keith Blount <email@hidden>)

  • Prev by Date: NSTreeController and NSPopupButton(Cell)
  • Next by Date: Re: how to make an NSWindow unmovable...
  • Previous by thread: RE: NSTextView setRulerVisible: weirdness
  • Next by thread: Re: NSTextView setRulerVisible: weirdness
  • Index(es):
    • Date
    • Thread