From: Allison N. <dem...@ma...> - 2008-08-05 08:50:42
|
OK, that worked like a charm, thanks Marcelo. I actually ended up creating a bundle, as I figure that this will probably be something of fairly general use, at least for my own apps. However, I wanted to ask the list if there isn't already a bundle that the community is using as a one-stop repository for storing an interface for these low-level C functions that I could add the call to. Alternatively, if there isn't such a repository, do people feel that it would be worthwhile to create one? I'd be happy enough to do the work to get the ball rolling. Alli On Monday, August 04, 2008, at 05:17PM, "Marcelo Alves" <mar...@xf...> wrote: > Write (and implement) a category in ObjC or a new class and use it >from RubyCocoa. > > >2008/8/4 Allison Newman <dem...@ma...>: >> Hi everyone, >> >> OK, for those that don't religiously follow cocoadev, I just asked a question over there about how to stop my Mac from going to sleep. The response was not exactly... ideal from the point of view of a RubyCocoa developer. Apparently the answer is to use the following: >> >> UpdateSystemActivity(OverallAct); >> >> Which is a pure C function call, with the prototype being found in power.h >> >> My question is: How do I best go about integrating this into a RubyCocoa app. I have previously written C Extensions to Ruby, but that doesn't seem to be a particularly flexible/reuseable solution. What is considered the best way of accessing this type of code, or better yet, has anyone already exposed this functionality for RubyCocoa? >> >> Thanks in advance for any help/guidance. >> >> Alli >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >> Build the coolest Linux based applications with Moblin SDK & win great prizes >> Grand prize is a trip for two to an Open Source event anywhere in the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Rubycocoa-talk mailing list >> Rub...@li... >> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk >> > >------------------------------------------------------------------------- >This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >Build the coolest Linux based applications with Moblin SDK & win great prizes >Grand prize is a trip for two to an Open Source event anywhere in the world >http://moblin-contest.org/redirect.php?banner_id=100&url=/ >_______________________________________________ >Rubycocoa-talk mailing list >Rub...@li... >https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > |