Agent library without UI elements

  • Hi i want to write an agent program that has a connection to Window Server
    and has a run loop.
    I have tried starting [NSapp run] in a separate thread with little success.
    Agent needs to be deployed as a library,
    started with method like Run() from an external program (perhaps python).
    It also needs to be free from any UI elements.

    How would i start such a process in the background? Is it at all possible?

    Thanks for replys,
    T. Keinonen
  • I read a bit about NSRunLoop, but what's very unclear to me is how to
    establish connection to window server? I need that for some callbacks.
    Is

    I take that if i give input source to a thread with a run loop it stays
    alive
    on the background.

    Thanks,
    T. Keinonen

    On Dec 2, 2007 8:56 PM, infinite labs <me...> wrote:

    > On 12/2/07, Teemu Keinonen <tkeinonen...> wrote:
    >> Hi i want to write an agent program that has a connection to Window
    > Server
    >> and has a run loop.
    >> I have tried starting [NSapp run] in a separate thread with little
    > success.
    >> Agent needs to be deployed as a library,
    >> started with method like Run() from an external program (perhaps
    > python).
    >> It also needs to be free from any UI elements.
    >>
    >> How would i start such a process in the background? Is it at all
    > possible?
    >
    > [NSApplication run] causes a connection to the window server and shows
    > up an icon in the Dock and all of that. If you don't want that, you
    > must forgo using the AppKit and use Foundation only. You probably want
    > to use NSRunLoop directly instead. See the docs for that.
    >
    > - $B!g(B
    >
  • On Dec 3, 2007 12:18 AM, $B!g(B <me...> wrote:

    >
    > Il giorno 02/dic/07, alle ore 20:15, Teemu Keinonen ha scritto:
    >
    >
    >> I read a bit about NSRunLoop, but what's very unclear to me is how to
    >> establish connection to window server? I need that for some callbacks.
    >> Is
    >
    > What kind of callbacks? What are you trying to accomplish?
    > Connections with the window server are only required if a. you are
    > using the UI or b. you are using "application-level" IPC such as Apple
    > Events/AppleScript.
    >

    CGRegisterScreenRefreshCallback is the callback i need to register to.
    It's either to use this or to get global dirty rectangle information
    by some other
    means.
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today