Modifying Stickies
Pages: 1, 2, 3, 4
Add a Drawer
Interface Builder makes it easy to add a drawer to nearly any window. Stickies windows are no exception. In the following steps, you'll discover how to add a drawer to your disclose button.
-
Return to Interface Builder.
-
Select the disclose button in the Window Editor. Open the Connections palette in the Info Editor (CMD-2) and scroll until you see toggleRuler:.
-
Click disconnect. The dot next to toggleRuler: disappears. The disclose button is no longer connected to that function.
-
In the Palettes window, click the fourth button at the top of the toolbar line. This reveals the Cocoa-Windows palette.
-
Drag the top-right icon, the one of a window with a drawer, onto your nib window.

Add new windows to an application by dragging them from the Windows Palette.
-
Locate the three new items that appear in your nib window: Parent Window, DrawContent, and NSDrawer.
-
Select Parent Window and press delete to remove it from your nib window.
-
Control-drag from the NSDrawer to the Window.

Control-dragging tells Interface Builder to create a new connection from
the NSDrawer to the Window.
-
In the Info Window's Connections palette, double-click parentWindow. A dot appears to the left of parentWindow. Doing this tells Interface Builder that the NSDrawer is the child of the Window and that the Window is the parent of the NSDrawer. This relationship helps Interface Builder know which drawer to show for each window.
-
In the nib window, double-click DrawContent... to open the DrawContentView editor window.
-
In the Palette, click the fifth button in the toolbar to open the Cocoa-Containers palette.
-
Drag a box onto the DrawContentView editor window.

Boxes help organize related controls.
-
Double-click the word Box and change it to "Stickies Controls." Then resize the box to provide more room to put controls inside. Feel free to make it nice and roomy. If it turns out too large, you can always readjust the size later.
-
In the palette, click the second button on the toolbar to open the Cocoa-Controls palette.
-
Drag three buttons and a checkbox into the Stickies Controls box. Edit their names to Check Spelling, Show Guess Panel, Print, and Show Ruler and arrange according to your tastes.

Dragging controls into a box helps arrange those controls with a bit of
visual flair.
-
Control-drag from the (currently unconnected) disclose button in the Window editor to the NSDrawer icon in the nib window.
-
In the Info Editor's Control palette, double-click toggle:. A dot appears next to the word toggle: when the connection is complete. Now, instead of toggling the ruler, the disclose button will toggle the drawer.
-
Control-drag from each button and checkbox in the drawer to the TextEdit area in the Window editor. Connect the Show Ruler checkbox to toggleRuler:; connect Check Spelling to checkSpelling:; connect Show Guess Panel to showGuessPanel:; and connect Print to print:.
-
Choose File -> Save (CMD-S) to save your changes to disk.
-
Return to the Stickies application.
-
Open a new Sticky (CMD-N) and test the updated disclose button. When clicked, it now opens the drawer that offers all the functionality you added with the new controls. Give it a try and confirm that everything works as expected.
After modding, Stickies now provides a secret drawer with extra controls.
In Summary
The mods shown in this article offer just a taste of the end-user customization possibilities available with Interface Builder. Hopefully, this brief tour will whet your appetite and encourage you to learn more about this excellent tool.
Restoring Stickies to Itself
To restore your application back to its original state, remove Stickies from your dock and then delete the modified version of your Stickies application in /Applications. Rename "Stickies copy" to "Stickies" and you're set. The copy stored an unmodified version of your application. By renaming it "Stickies," it becomes the standard Stickies application.
| If desired, for the pedants among us, launch a terminal shell and change
the ownership back to root as follows: |
Erica Sadun has written, co-written, and contributed to almost two dozen books about technology, particularly in the areas of programming, digital video, and digital photography.
Return to MacDevCenter.com.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 11 of 11.
-
Stickies in Documents
2007-04-03 10:25:28 bigBOON [Reply | View]
Anyone know if/how to apply a sticky note to a document instead of the desktop, so when passing documents from 1 person to another their notes stay for communication purposes?
i.e. I have a Word document that I would love to apply a stickie to so I can remember in 2 weeks where I was with it, where I was going, conversations surrounding it, etc.
If this isn't possible, I think it would be a great addition to the program. Similar to applying real sticky-notes to documents in a file cabinet.
-
changing color options
2006-08-21 12:57:49 fabcupcake [Reply | View]
i'd like to change the color options in the Stickies Color pulldown menu. how would i go about doing this? is there another site anyone can point me to that has such thorough directions?
-
Stickies comments & question
2006-02-12 18:56:57 fixdmix [Reply | View]
Very cool article... thanks very much. Stickies just became twice as useful to me.
First, my question:
When printing a stickie, a footer is inserted containg the date, page, and (I believe) Application /User. I have looked high and low to hunt down and kill this footer text with no luck. Is this a preference to be modified elsewhere, or is it inherent to the app, and can it be modified?
And a commeent or two:
The article is fantastic and easy to follow except for some nomenclature used:
- The "disclose button" referred to is actually never called that in my version of Interface Builder. The info text actually refers to it as the "NSButton".
- The "info window" referred to is never called that, but more often called the inspector (context dependant). This was somewhat confusing a few times.
Thanks again !!!
Mark Dennis
Las Vegas
-
stickies database
2005-12-29 14:15:00 brads [Reply | View]
i want to be able to use stickies stored in the StickiesDatabase in my Cocoa/Java app...any ideas? -
stickies database
2005-12-29 17:16:31 Erica Sadun |
[Reply | View]
I believe you need to use the NSUnarchiver class. The data is stored in a typed stream as an array (if I recall correctly) of data objects that store rich text.
-
stickies at startup
2005-07-22 22:23:38 acemillion [Reply | View]
I love stickies. Is there a way to make them active at startup without clicking on them?
-
Challenge :: Add a Search Filter to Keychain Access
2005-01-16 04:07:53 nosumo [Reply | View]
I've tried to generalise from this less to do it myself but I just got lost. I challenge you to use techniques similar to those in this article to add a search filter to the Keychain Access application.
I'm sure you all know how irritating it is to scroll through hundreds of keychain items looking for the one you want to read, wondering if it's listed under www.example.com or example.com or store.example.com or login.example.com or whatever. A search filter would be so helpful.
Good Luck
Cheers
Meeriam
-
Oops? Command references replaced by 'z'
2004-11-24 08:50:47 davidro [Reply | View]
I am sure you really meant to use the word "command" instead of 'z' when describing the keyboard shortcuts...
Great article! Lots of detail, easy to follow.. I know what i'm doing on my next break!
dAVE
-
Excellent tips!
2004-11-23 17:10:19 greenergrad [Reply | View]
This was an interesting look at some of what users can do with the stock applications. I have always wanted a live word count feature in TextEdit (say, in a status bar at the bottom of the window). I'd love to see that in an article.
Thanks!






just wanted to say that it's also possible to replace the existing font-menu with the standard one which gives the advantage that apple-plus/apple-minus shortcuts work as they do in TextEdit (make selected text bigger/smaller). To do that one has to do the following:
1. open the "MainMenu.nib"-file within the ressources/english.lproj-folder.
2. open/doubleclick on the MainMenu-entry within the "instances"-window (this should open the menubar and makes it possible to edit it. For example, clicking on one entry opens its' sub-entries and hitting "delete" removes a selected menu-entry. This might be a way do declutter menus but I wouldn't recommend it, as it seems (as is shown with the font-resize-function) that if you remove a menu-entry, the shortcut doesn't work anymore, too).
3. Drag the "font"-entry from the Cocoa-menus-palette to the menubar (this should add a second font-menu to the bar)
4. chose the old "font"-entry and hit delete to remove it.
5. save the new bar
It seems that you have to restart Stickies to make the changes work. Probably not the most elegant way to do it, but it's simple and seems to work fine for me. The best thing is that you now can resize the selected text via the usual shortcuts :-)