NSMenuExtra tutorial Part 2 of 2
NSMenuExtra tutorial Part 2 of 2
- Subject: NSMenuExtra tutorial Part 2 of 2
- From: Rustam Muginov <email@hidden>
- Date: Tue, 23 Sep 2003 12:24:40 +0400
Continued from Part 1
------
Removing MenuExtra.
You can Control-drag the menu extra away from the menu bar. Then you
done it, the SystemUIMangar still keep the cached information about the
menuextra, so if you change it and recompile, it would load old version.
Also, you would not be able to put the menuesxtra to Trash and empty it -
because file is busy. You should stop the SystemUIManager with the terminal
"killall SystemUIManager" command. This command would kill the process, and
the MacOS X would automaticaly relaunch SystemUIManager - but now without
your menuextra. If you doing some code editing/recompilation, remember to
kill SystemUIServer before you run changed menuextra.
Where to go next?
The example above is very basic, it only demonstrates the "minimal" menu
extra. What you would like to do is to assign the target and action to menu
command. Also, it is worth to load two image (general and "menu down") at
the menuextra initialisation and use them to draw the SampleMenuView draw
method, using isMenuDown to check if user pressed mouse in our menu.
Then, study the already mentioned menu extras and check what they do.
I hope what this short tutorial helped you to understand this part of
MacOS X development.
If you do have some questions, or if you think its worth to put this
tutorial onto some web sites, please contact me
rustam (at) ruscode (dot) com
rust (at) dataforce (dot) net
Sincerely,
Rustam Muginov
History of changes:
<Draft 21.09.2003> - created
<Draft 23.09.2003> - edited the styles, and added "Where to go next".
-----------------
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.