Welcome to Soft32 Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Interface Builder: NSTextView over NSImageView

 
   Soft32 Home -> Mac -> Programmer Help RSS
Next:  Powerpoint crashes when opening even after  
Author Message
Simon Slavin

External


Since: Dec 28, 2008
Posts: 37



(Msg. 1) Posted: Tue Aug 25, 2009 1:20 pm
Post subject: Interface Builder: NSTextView over NSImageView
Archived from groups: comp>sys>mac>programmer>help (more info?)

I'm having trouble getting Interface Builder to understand what I want.
Could someone help me ? I'm using OS 10.5.8 with Xcode 3.1.2 and IB
3.1.2. As far as I know everything is the latest version, I'm using an
'xib' file, and it doesn't matter if my application only runs on 10.5
and greater.

In my window I have an NSTextView. Actually, since it's difficult to
create one directly it's inside an NSScrollView, and the scroll view
has both scroll bars hidden. What I want to do with it is to use non-
transparent text on a transparent background. I'm trying to
demonstrate that the background is transparent by showing an image
behind it. The effect should be something like Preview uses to show
which parts of an image are transparent. So if there was, for example,
a letter 'a', there would be hole in the 'a' through which you could
see my graphic.

I have an image file (I tried PNG and TIFF) in my project. I dragged
it out of the media pane and onto my window and I get an Image Cell
inside an Image View. It looks fine in the editing window but problem
1 is that it does not show up at all when I use 'Simulate Interface'.
However it does show up if I tell Xcode to run my application (which so
far has no code, it just shows the window). So am I doing it wrong or
is there a bug in the simulator ?

Problem 2 is that I can't work out what settings in the NSScrollView
and the NSTextView to use to make the text non-transparent and but the
area around it transparent, so you can see my graphic in the spaces
inside and around the text. A further complication is that the user
must be able to set the font and other text properties in the
NSTextView, so I can't just use an NSTextField. So Problem 2 is to
work out which of the five different color wells I need to set to
transparent and which not. I think I've now tried every combination.

I think I should be able to do all this purely in IB, without writing
any code. But I could be wrong. I would be grateful for any help.

Simon.

--
I'm trying a new usenet client for Mac, Nemo OS X, since 0 days.
You can download it at http://www.malcom-mac.com/nemo
Back to top
Login to vote
Luddite Wacko

External


Since: Nov 24, 2008
Posts: 15



(Msg. 2) Posted: Sat Aug 29, 2009 3:33 pm
Post subject: Re: Interface Builder: NSTextView over NSImageView [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Simon Slavin wrote:
} I'm having trouble getting Interface Builder to understand what I want.
} Could someone help me ? I'm using OS 10.5.8 with Xcode 3.1.2 and IB
} 3.1.2. As far as I know everything is the latest version, I'm using
} an 'xib' file, and it doesn't matter if my application only runs on
} 10.5 and greater.
}
} In my window I have an NSTextView. Actually, since it's difficult to
} create one directly it's inside an NSScrollView, and the scroll view
} has both scroll bars hidden. What I want to do with it is to use non-
} transparent text on a transparent background. I'm trying to
} demonstrate that the background is transparent by showing an image
} behind it. The effect should be something like Preview uses to show
} which parts of an image are transparent. So if there was, for example,
} a letter 'a', there would be hole in the 'a' through which you could
} see my graphic.
}
} I have an image file (I tried PNG and TIFF) in my project. I dragged
} it out of the media pane and onto my window and I get an Image Cell
} inside an Image View. It looks fine in the editing window but problem
} 1 is that it does not show up at all when I use 'Simulate Interface'.
} However it does show up if I tell Xcode to run my application (which
} so far has no code, it just shows the window). So am I doing it
} wrong or is there a bug in the simulator ?
}
} Problem 2 is that I can't work out what settings in the NSScrollView
} and the NSTextView to use to make the text non-transparent and but the
} area around it transparent, so you can see my graphic in the spaces
} inside and around the text. A further complication is that the user
} must be able to set the font and other text properties in the
} NSTextView, so I can't just use an NSTextField. So Problem 2 is to
} work out which of the five different color wells I need to set to
} transparent and which not. I think I've now tried every combination.
}
} I think I should be able to do all this purely in IB, without writing
} any code. But I could be wrong. I would be grateful for any help.
}
} Simon.
}

Select the text view within the bordered scroll view, open the
attributes inspector, uncheck "draws background"
Back to top
Login to vote
Luddite Wacko

External


Since: Nov 24, 2008
Posts: 15



(Msg. 3) Posted: Sat Aug 29, 2009 3:54 pm
Post subject: Re: Interface Builder: NSTextView over NSImageView [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Simon Slavin wrote:

} I have an image file (I tried PNG and TIFF) in my project. I dragged
} it out of the media pane and onto my window and I get an Image Cell
} inside an Image View. It looks fine in the editing window but problem
} 1 is that it does not show up at all when I use 'Simulate Interface'.
} However it does show up if I tell Xcode to run my application (which
} so far has no code, it just shows the window). So am I doing it
} wrong or is there a bug in the simulator ?

Try this:

Drag an image well from the Library to the window

Set it up the way you want (I would guess no border, not editable)

Go to the attributes inspector and select the image you want from the
Image menu at the top (if it exists as a file in your project, it should
show up in this menu)
Back to top
Login to vote
Simon Slavin

External


Since: Dec 28, 2008
Posts: 37



(Msg. 4) Posted: Mon Aug 31, 2009 5:20 pm
Post subject: Re: Interface Builder: NSTextView over NSImageView [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 08-29-2009, Luddite Wacko <sydde.TakeThisOut@undernet.org> wrote:
> Select the text view within the bordered scroll view, open the
> attributes inspector, uncheck "draws background"

I did eventually make it work, but I tried so many combinations in the
meantime that I don't remember which one made the difference.

There definitely is a bug in Interface Builder's simulation app,
though: it now looks fine inside my app but not in the simulator.

--
I'm trying a new usenet client for Mac, Nemo OS X, since 0 days.
You can download it at http://www.malcom-mac.com/nemo
Back to top
Login to vote
Luddite Wacko

External


Since: Nov 24, 2008
Posts: 15



(Msg. 5) Posted: Wed Sep 02, 2009 5:34 pm
Post subject: Re: Interface Builder: NSTextView over NSImageView [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Simon Slavin wrote:
} On 08-29-2009, Luddite Wacko <sydde DeleteThis @undernet.org> wrote:
}> Select the text view within the bordered scroll view, open the
}> attributes inspector, uncheck "draws background"
}
} I did eventually make it work, but I tried so many combinations in the
} meantime that I don't remember which one made the difference.
}
} There definitely is a bug in Interface Builder's simulation app,
} though: it now looks fine inside my app but not in the simulator.
}

I am using IB 3.1.2 on a G4 and having no problems with the simulator.
The key thing to remember is that an NSTextView in IB is two things: a
scroll view with a text view embedded in it. In the NIB window in
outline view, you can select the superview (scroll view) as well as the
subview (text view). Select each of these and uncheck "Draws Background"
for each of them. This is what works for me.
Back to top
Login to vote
Simon Slavin

External


Since: Dec 28, 2008
Posts: 37



(Msg. 6) Posted: Thu Sep 03, 2009 5:20 pm
Post subject: Re: Interface Builder: NSTextView over NSImageView [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 09-02-2009, Luddite Wacko <sydde.RemoveThis@undernet.org> wrote:
> Simon Slavin wrote:
> } There definitely is a bug in Interface Builder's simulation app, 
> } though: it now looks fine inside my app but not in the simulator.

> I am using IB 3.1.2 on a G4 and having no problems with the
> simulator.  The key thing to remember is that an NSTextView in IB is
> two things: a  scroll view with a text view embedded in it. In the
NIB
> window in  outline view, you can select the superview (scroll view)
as
> well as the  subview (text view). Select each of these and uncheck
> "Draws Background"  for each of them. This is what works for me.

Yep. That's what I did. And it looks fine when I run my application.
And the simulator built into Interface Builder still does not display
any of the image properly. Since the simulator does not simulate
correctly, I have to assume there's a bug somewhere.

--
I'm trying a new usenet client for Mac, Nemo OS X, since 0 days.
You can download it at http://www.malcom-mac.com/nemo
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Interface builder bugs? - Hi, Is this a known bug that the IB does not allow to set the size of a drawer properly. It seems that the height of....

interface builder woes - I am having a number of problems with Interface Builder 2.4, for which the Help is marginal at best. This is somethin...

Interface Builder's Symbols? - In Intertface Buider the outline view displays the nested hierarchy of all of the objects in the nib and the data paths...

Populating a NSPopUpButtonCell in Interface Builder - In Interface Builder, how do you populate an NSPopUpButtonCell which is the data cell in an NSTableColumn? -- I am..

Interface Builder and Xcode for newbie. - I there. I know Java. I'm doing the http://lesi.host.sk/dvd/dvd_screen.png app! But i don't have a good book about..

NSPopupButtonCell and NSTableView in Interface Builder - For some reason, if I put an NSPopupButtonCell in a table column of an NSTableView, and set the size of the cell to..
       Soft32 Home -> Mac -> Programmer Help All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum

Categories:
 Windows
 Linux
  Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]