• 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
Turning modal call into non-modal operation?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Turning modal call into non-modal operation?


  • Subject: Turning modal call into non-modal operation?
  • From: Per Persson <email@hidden>
  • Date: Fri, 3 Jan 2003 15:15:37 +0100

Hi,
I'm trying to glue together some legacy code with a Cocoa GUI and I've come across a situation where the old code needs feedback from the GUI. The call I'm recieving is in principle

char * getCursor(int x, int y, int *finalX, int *finalY)

which expects a modal operation placing a marker at (x, y), allowing the user to move it around and at the press of a key or mouse button return the final position along with the key/button pressed.

Given that I don't want that kind of modal behaviour in the GUI, are there any clean way of accomplishing that? My present idea is to have a thread separate from the main thread that receives the getCursor call and then initializing the input process and then wait for some kind of "semaphore" to indicate that the user has ended the session and then return. (The code issuing the call is already running in a different thread, but it is not in my power to change the way it works.)

Is the above the "correct" solution to the problem, or is there a smarter way?

TIA,
Per
_______________________________________________
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.

  • Prev by Date: Re: Write text to the stdout
  • Next by Date: Re: Write text to the stdout
  • Previous by thread: Re: Write text to the stdout
  • Next by thread: To Document-Base or not Document-Base...
  • Index(es):
    • Date
    • Thread