Re: Text fields doesn't draw in a custom view
Re: Text fields doesn't draw in a custom view
- Subject: Re: Text fields doesn't draw in a custom view
- From: Ivan Myrvold <email@hidden>
- Date: Mon, 20 May 2002 15:34:36 +0200
I used the whole day yesterday, trying different things to make this
work, but failed.
Today, I made a test project, documenting every step on the way, to show
what I am trying to do, and posted it to my web site. I kept it very
detailed, in case some newbies wanted to see how you could replace a
view this way. My project has no resemblance with this small project,
only the technique of moving new views into the window is similarly,
only that I use a drawer with an ouline view to select new views.
Check it out at
http://www.myrvold.org/cocoa/replaceviewtest/replaceview1.html
(There is a link to the next page on the bottom of the pages).
Ivan
Pe mandag, 20. mai 2002, kl. 00:03, skrev Anthony Arthur:
I don't think you have properly arranged these views within you nib. It
is not clear how exactly you want them to appear, but just because
things like right in the nib does not mean they will look the same at
run time. I would suggest experimenting with the 'Bring to front' &
'Send to back' features, and be sure to observe which view is selected
in your window as you drag another view into it. IB will outline the
selected view as you drag another object over it and insert it there
when it is dropped.
hope that helps...
--Brian
On Sunday, May 19, 2002, at 08:57 AM, Ivan Myrvold wrote:
I somehow succeeded in being able to write something in the text view,
by forcing it to be first responder, with the following:
[[self window] makeFirstResponder:omytextfield]
I then am able to click inside the NSTextField, it shows the white
background of the text field, and I can see what I writes. But as soon
as I click outside the text field, it disappears again.
But this is not a good solution.
Ivan
Pe sxndag, 19. mai 2002, kl. 12:59, skrev Ivan Myrvold:I have printed
out the view hierarchy below, if that can be of help:
(gdb) po [oscrollView subviews]
(<NSClipView: 0x3537710>, <NSScroller: 0x3507b70>, <NSScroller:
0x34d6c10>)
(gdb) po omyview
<NSView: 0x384ff00>
(gdb) po omytextfield
<NSTextField: 0x3811660>
(gdb) po [0x3811660 superview]
<NSView: 0x384ff00>
(gdb) po [omytextfield superview]
<NSClipView: 0x3537710>
Ivan
Pe sxndag, 19. mai 2002, kl. 12:50, skrev Ivan Myrvold:I have a
fairly complicated view hierarchy, in a nib file.
I have a window with a custom view, contained in an NSScrollView..
I have a view defined in that nib file consisting of an NSImageView,
and some NSTextField's dropped on top of that.
In my code, I am setting the view in the window with the call:
[oscrollView setDocumentView:omyview]
[omyview scrollPoint:punkt] // just to scroll the view to the top
The window is showing the image contained in the "omyview"
NSImageView just fine, but the text fields on top of that view
doesn't show at all, although by hovering the cursor over where the
text fields are supposed to be, changes the cursor to the correct
icon (I-beam, or whatever it's called). So the text fields are
there, but why doesn't they show up. Clicking inside the text fields
only results in an alert sound.
I have put the text fields in front with the "Bring to front"
command in the IB's Layout menu, and connected all the outlets.
Ivan
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
Ivan C Myrvold
OrtopediService AS
Mob. 913 16 356
Tlf. 38 14 45 93
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.