 |
 |
Several Event questions
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
Okay, I have some questions about catching certain events which will make my life a lot easier. Hopefully someone out there can help me, but if not, no biggie.
1. I need to be able to have a floating window catch *ALL* mouse over events, even when it's associated app is not frontmost. I sort of need to be able to do what the dock does, handle mouse overs, regardless of what app you're in. The app Dock-It does it too.. but I'm not sure how. I hope not polling....
2. Is there a way to catch when an app requests going to full screen? I know the dock gets some sort of a notification, and I was wondering if there was a public interface to finding that information out.
3. Does anyone know how to work with Carbon Menu Manager? I want to have an NSMenu that dynamically creates its menu items the way the dock does it: after the menu item that links to a submenu is selected. I essentially need to be able to acquire information on the fly instead of all at once. I'm just a Cocoa guy, so Carbon stuff is pretty foreign to me.
I think I had some other questions, but these will do for now (I need to go eat and then catch MIB2 with my gf)
Thanks!
Matt Fahrenbacher
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2001
Status:
Offline
|
|
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by Ghoser777:
<strong>1. I need to be able to have a floating window catch *ALL* mouse over events, even when it's associated app is not frontmost. I sort of need to be able to do what the dock does, handle mouse overs, regardless of what app you're in. The app Dock-It does it too.. but I'm not sure how. I hope not polling....</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">I'm not sure if this is what you want, but try adding one of the following to your application's Info.plist
</font> - <font size="1" face="Geneva, Verdana, Arial, sans-serif">NSUIElement
</font></li>
- <font size="1" face="Geneva, Verdana, Arial, sans-serif">LSUIElement
</font></li>
- <font size="1" face="Geneva, Verdana, Arial, sans-serif">NSBGOnly
</font></li>
- <font size="1" face="Geneva, Verdana, Arial, sans-serif">LSBGOnly
</font></li>
<font size="1" face="Geneva, Verdana, Arial, sans-serif">FYI, the Dock uses NSUIElement as does the Script Runner (in /Applications/AppleScript).
As to a full-screen notification, the way some apps full screen app is to simply put up a sheilding window on the main screen (see <a href="http://www.cocoadevcentral.com/tutorials/showpage.php?show=00000020.php)." target="_blank">http://www.cocoadevcentral.com/tutorials/showpage.php?show=00000020.php).</a> So, the Dock would hide automatically in this case. I *think* there might be other ways, as in Carbon there is the ability to explicitly hide the menu bar.
As for 3, have you tried connecting an action to your submenu. If this is sent when the submenu is opened, you would have the ability to populate the submenu.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2001
Status:
Offline
|
|
As I think about it more, I realize that when a request to show/hide the menu bar is posted, the Dock also hides/shows. In the Dock executable, one can find in the _TEXT segment a com.apple.HIToolbox.menuBarShownNotification and com.apple.HIToolbox.menuBarHiddenNotification. (And, BTY, while examining the executable and doing a class-dump, I discovered the Dock is *gasp* a Carbon app...maybe it's the first good example of one  ). These notifications may be public, so just check (I'm not on my dev machine...that's hosed  ). Hope this helps  .
<small>[ 07-07-2002, 09:02 PM: Message edited by: Ibson ]</small>
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">I'm not sure if this is what you want, but try adding one of the following to your application's Info.plist
</font> - <font size="1" face="Geneva, Verdana, Arial, sans-serif">NSBGOnly
</font></li>
- <font size="1" face="Geneva, Verdana, Arial, sans-serif">LSBGOnly
</font></li>
<font size="1" face="Geneva, Verdana, Arial, sans-serif">FYI, the Dock uses NSUIElement as does the Script Runner (in /Applications/AppleScript).
</font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">I've been using NSUIElement, as well as PSEventHandling (something I stole for the Dock's plist), but these have not been useful (save making my app have no dock icon and respond to right clicks, respectively). Looking at Docki-It's Info.plist, I didn't see anything out of the ordinary, which makes me think there's something code wise that I'm missing. Do I need to get a reference to the carbon version of window and work with that?
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">
As for 3, have you tried connecting an action to your submenu. If this is sent when the submenu is opened, you would have the ability to populate the submenu.</font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">Not quite. NSMenu's don't have target/action, although submenuAction: is supposedly the "action method assigned to menu items that open submenus." Unfortunately, I tried overriding it in a subclass of NSMenu, but the method never seems to get called... which is strange.
Matt Fahrenbacher
<small>[ 07-08-2002, 02:15 AM: Message edited by: Ghoser777 ]</small>
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|