Titleless Windows

I’ve only found one or two topics that helped but I think the implementation is outdated.
I just want to take the title bar off of my main window.



just set the title of the main window to an empty string

set title of window "main" to ""

That works for removing the title, but I am looking to remove the entire title BAR off of the window.
I know that there is some ObjC involved but the only posts are based on older versions of IB as far as I could tell.

Thanks for the response StefanK

I’d be very interested in this info too. All the other posts use the old version of Interface Builder. Thanks.

You do realize that if you remove the title bar that everything else about a window automatically gets removed too… so you can’t move it, you can’t resize it, you can’t minimize it… nothing. As such here’s how to do it. Create a new file in your project, make the new file an objective-c class file, and name it BorderlessWindow.m. You don’t need a “.h” file just the .m file. Then add this code to that file.

Now open your main nib file in IB. While still in IB, drag the BorderlessWindow.m file from xcode onto the nib window in IB. Then select the window in the nib file. In the inspector go to the Identity section for the window and set its class to “BorderlessWindow”. That’s it.

Note: if you also want this to be a full screen window you need to change this…


Ok, I’m feeling REALLY STUPID, but how do you drag the .m file from XCode into IB? Where are you supposed to drag it in IB? I can’t make it go. Sorry if this is a silly question.

The file won’t show up so don’t worry. Just drag it and then go on to the next step. It’ll work.

Is there another way to get the .m file in to IB? I really can’t get the drag to do anything. It always snaps back to where I grabbed it from.

That’s how it’s supposed to work, just go on to the next step.

Well, it doesn’t show up in the class list, so obviously I’m doing something wrong. Sorry for being such an idiot…

Just type in the value yourself! Don’t make this harder than it has to be. Just follow my directions and put in the value I told you. Did you try that?

OK, got it. Sorry.

You wrote:

“In the inspector go to the Identity section for the window and set its class to “BorderlessWindow”.”

I took the word “set” to mean it would appear in the pulldown list, which it does not. I seem to recall in the old IB that the “myWindow” class that we created to do this (per old examples) would show up in a list of available classes. Anyway, it works now, thanks so much for the help, sorry I made it overly complicated. :slight_smile:


It would appear if there was a “.h” file and you had dragged that h file to the IB nib window instead of the “.m” file… but we’re not using an h file so we just type it in. Actually, I’m not sure if you have to drag the “.m” file at all, but it doesn’t hurt so I included it as a step.

Anyway, I’m glad you got it working. :slight_smile:

Yeah, I don’t think dragging the .m file does anything, probably better to skip that step. Thanks again for the help. :slight_smile: