• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Getting a Service-based app frontmost
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting a Service-based app frontmost


  • Subject: Getting a Service-based app frontmost
  • From: Ken Tabb <email@hidden>
  • Date: Thu, 20 Jan 2005 18:00:23 +0000

Hi folks,

after extensive searching on Cocoa Builder I still can't fathom a way to do this.

I have a Service based app which offers 1 service. In the method that gets called, I need my app's one and only window to become frontmost, and furthermore, for a specific NSControl to become key, so that after pressing the Service shortcut (when in another app) you can continue pressing keys in order to interact with the Service app's GUI.

I can get as far as making the app's window frontmost. That's easy, there are loads of ways to do it, ranging from setting the window level to an "always in front" level such as NSScreenSaverLevel / NSStatusWindowLevel / NSFloatingWindowLevel etc. to telling the window -makeKeyAndOrderFront etc.

However, nothing I try allows my control (an NSTableView) to become first responder _when_ called from the Service. Lots of things work fine from within the fired up app (that offers the service) but when invoked as a service, stuff doesn't work.

For instance as a desperate measure I even tried [[NSWorkspace sharedWorkspace] hideOtherApplications]... this works when run from 'within' the app, but when invoked from a service, it does nothing (it gets called... but that's about it). It doesn't even hide the 'wrong' apps (i.e. in case at time of execution it thinks the invoking app is the frontmost)... weird.

If I invoke the service, then as I say I get the window frontmost. I can then manually click on the tableView's background (empty rows) and it's fine, I can then get key presses in the tableview. But it's a wee bit inelegant from the point of the user...

Am I thinking about this wrong? Is there a better way to present a responsive service GUI from a single (service menu) keypress?

Thanks in advance for any tips,
Ken

- - - - - - - - - -
Dr. Ken Tabb
Mac & UNIX Developer - Health & Human Sciences
Machine Vision & Neural Network researcher - School of Computer Science
University of Hertfordshire, UK
http://www.health.herts.ac.uk/ken/

Certified non-Microsoft Solution Provider

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Getting a Service-based app frontmost
      • From: Ken Tabb <email@hidden>
  • Prev by Date: Re: Assigning a custom formatter to a tablecolum in email@hidden
  • Next by Date: Displaying symbol for Enter key in menu item
  • Previous by thread: Re: Is there any support in Cocoa for stupidly encoded UTF-8 string?
  • Next by thread: Re: Getting a Service-based app frontmost
  • Index(es):
    • Date
    • Thread