Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

guitarmaster18

macrumors regular
Original poster
Mar 27, 2007
158
0
So, here's the situation. I have a NSToolbar, set up through the normal programmatic method. One item I have is set up through an NSView. The NSView contains a text field. How would I set autosizing rules for the text field?


Thank You!
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
I guess it depends on how you want it to behave when resized, but I'd say to have its width adjust so that when the NSView expands the textfield expands along with it.
 

guitarmaster18

macrumors regular
Original poster
Mar 27, 2007
158
0
I guess it depends on how you want it to behave when resized, but I'd say to have its width adjust so that when the NSView expands the textfield expands along with it.

Well, when resized, I want the text field to contract and expand in the toolbar based on the size of the window. Do you know if that is possible?

Thanks!
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Well, when resized, I want the text field to contract and expand in the toolbar based on the size of the window. Do you know if that is possible?

Have you tried playing with the view's autoresizing mask (in IB) and seeing if it works already? Safari does this with the "address and search" item, so it's possible.
 

guitarmaster18

macrumors regular
Original poster
Mar 27, 2007
158
0
Have you tried playing with the view's autoresizing mask (in IB) and seeing if it works already? Safari does this with the "address and search" item, so it's possible.

Yeah, I've tried the traditional method (IB) many times. It doesn't seem to make any difference in the way the Text Field is resized in the toolbar.

Thank you,
guitarmaster18
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Well you'll probably have to set the view's frame manually when the window resizes. Even then it might not work.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.