NSWindow resizing [duplicate] - objective-c

This question already has answers here:
Disable window stretching Cocoa?
(2 answers)
Closed 10 years ago.
Hello I was wondering if anyone knew of a method or way that you stop the user resizing your window for a Cocoa / Mac OS X application.
If this is not not possible how would you go about resizing the window uniformally.

Set the min and max sizes to the desired size.
CGSize fixedSize = myWindow.frame.size;
[myWindow setMinSize:fixedSize];
[myWindow setMaxSize:fixedSize];

Related

Objective-C continuous horizontal scrolling text [duplicate]

This question already has an answer here:
How to make marquee UILabel / UITextField / NSTextField
(1 answer)
Closed 8 years ago.
is it possible to create continuous horizontal scrolling for UILabel in Objective-C.
The code in HTML would look like this, so you can get a better idea what I'm talking about.
<marquee behavior="scroll" direction="left">Scrolling text goes here</marquee>
Thanks!
There's no built in control that provides this functionality. You may want to take a look at the open source project MarqueeLabel, which is a subclass of UILabel that adds support for this effect.

UIView center, frame [duplicate]

This question already has answers here:
How to test if a point is in a view
(5 answers)
Closed 9 years ago.
I am wondering how to check if a view's center is in the frame of another UIView?
Example: if I have a circle which can be dragged by your finger and it's center point gets dragged to a square's frame some code gets executed?
Thanks in advance,
Best regards!
You should have a look at Apple's CGGeometry Reference. In particular, you could use CGRectContainsPoint.

How can I blur area? [duplicate]

This question already has answers here:
How to apply blur to a UIView?
(5 answers)
Closed 9 years ago.
I have a UITableView and UIView (orange). I need that when I scroll a table, under orange area my table has a blurred. Can everybody help me? Thanks.
You could do it like described here: Apply blur to UIView
But blurring is computationally intensive, and scrolling performance will most likely be bad.
Make the orange view over the tableview, then set it's opacity.

Rounded labels in Interface Builder...? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How do I create a round cornered UILabel on the iPhone?
how to use rounded corner label in iphone,UILabel Round Corners
Still pretty much getting started with Xcode and Interface Builder. I made a UI screen with several 'label' fields to display random data. But when I change the label color from the screen background color, it looks awful because they're perfect squares. Is there a way to round the corners for labels?
Thanks!
Quoting from another SO answer:
iPhone OS 3.0 and later supports the cornerRadius property on the CALayer class. Every view has a CALayer instance that you can manipulate. This means you can get rounded corners in one line now:
That post has a pretty detailed description of how to implement this behavior.

How do I set the font size in an iPhone text field? [duplicate]

This question already has answers here:
How to change textfield font size programmatically?
(6 answers)
Closed 7 years ago.
I have a UITextField in a view (on an iPhone) but the input text appears very small. I don't see an option in Interface Builder to set the size.
Is there a way to set it declaratively or do I have to resort to code?
You can do it in code as well:
myUITextField.font = [UIFont systemFontOfSize:12.0f];
Cheers.
Press Cmd-T for the Fonts panel.