In OpenGL some functions take pointers and these are easily handled via
v = Pointer.new('f', 20)
glVertexPointer(3, GL_FLOAT, 3, v)
(the C prototype is
void glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *
pointer);
however in some cases this function has been over
I'm trying to create a custom URL scheme following the instructions
here http://www.cocoadev.com/index.pl?HowToRegisterURLHandler and in
the Cocoa Scripting Guide p108. I've not been getting anywhere! I've
got at least two problems here:
(I'm running OS X 10.6.6 with MacRuby 0.8)
# Attempt #1
# Ap
In Ruby constants start by an upper case letter, swap `kInternetEventClass'
by `KInternetEventClass' and give it a try.
For a bit more info:
http://ofps.oreilly.com/titles/9781449380373/ch01.html#_constant_names
- Matt
On Mon, Jan 10, 2011 at 9:05 AM, Martin Hawkins wrote:
> I'm trying to create
Thanks Matt, I've got the book but missed that point.
Any suggestions re my second issue. i.e. translating the selector part
of
sharedAEManager.setEventHandler(self, andSelector:getURL(event,
withReplyEvent:returnEvent), forEventClass:kInternetEventClass,
andEventID:kAEGetURL)
into it's Ruby equiva
On Jan 10, 2011, at 5:52 PM, Martin Hawkins wrote:
> sharedAEManager.setEventHandler(self, andSelector:getURL(event,
> withReplyEvent:returnEvent), forEventClass:kInternetEventClass,
> andEventID:kAEGetURL)
This does not produce any errors:
sharedAEManager.setEventHandler(self, andSelector:g
Is there anything I can piggyback on to implement syntax highlighting in a
Cocoa editing window?
Is there some Ruby lexing code, for example, that I can reuse?
Thanks, Joel
---
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
__
On 2011-01-10, at 15:52 , Martin Hawkins wrote:
>
> Thanks Matt, I've got the book but missed that point.
> Any suggestions re my second issue. i.e. translating the selector part
You can pass a selector as a symbol or string:
m.setEventHandler(self, andSelector:
:"getURL:event:withReplyEvent:re
Joel, I've also got to change getURL to
def getURL(event, returnEvent)
# do something with event here to parse the url
end
so I go with your suggestion, I'm going to get 'wrong number of
arguments (0 for 2)'
On Jan 10, 5:59 pm, Joel Reymont wrote:
> On Jan 10, 2011, at 5:52 PM, Martin Ha
Excellent Caio - thanks.
Now I've gone full circle and am getting
'AppDelegate::KInternetEventClass (NameError)
from /Users/martin/work/macruby/experimental/build/Debug/
experimental.app/Contents/'
Code is now:
framework 'Foundation'
# framework 'ApplicationServices' - it doesn't matter wh
On 2011-01-10, at 16:47 , Martin Hawkins wrote:
>
> Excellent Caio - thanks.
> Now I've gone full circle and am getting
> 'AppDelegate::KInternetEventClass (NameError)
> from /Users/martin/work/macruby/experimental/build/Debug/
> experimental.app/Contents/'
Maybe that constant is not there
Now that's interesting - I tried your macirb experiment and get a
different result:
mar...@polaris:~ macirb
irb(main):001:0> framework 'Foundation'
=> true
irb(main):002:0> KInternetEventClass
NameError: uninitialized constant KInternetEventClass
irb(main):003:0> framework 'Cocoa'
=> true
irb(main
The constant *should* be there - this is an excerpt from my HIServices/
InternetConfig.h
/
Apple event constants
*
Try installing the latest bridge support.
http://bridgesupport.macosforge.org/trac/wiki/Releases
On 2011-01-10, at 17:18 , Martin Hawkins wrote:
>
> Now that's interesting - I tried your macirb experiment and get a
> different result:
> mar...@polaris:~ macirb
> irb(main):001:0> framework 'Found
That seems to have fixed it!
Many thanks to you all for your help.
On Jan 10, 7:59 pm, Caio Chassot wrote:
> Try installing the latest bridge support.
>
> http://bridgesupport.macosforge.org/trac/wiki/Releases
>
> On 2011-01-10, at 17:18 , Martin Hawkins wrote:
>
>
>
>
>
>
>
> > Now that's inter
Hi Joel,
For simplicity, I recommend to use the ripper extension for that. It has a
lexer API. I don't know if there is sample code available, but the API itself
isn't very difficult to understand and use. Look for the Ripper::Lexer class.
Based on the returned tokens, you can then colorize you
I would like to do
mungedRegistration = [...]
registrationString = NSString.stringWithUTF8String(mungedRegistration)
but this results in
can't convert Array into String (TypeError)
What is the best approach here?
I do need my munged registration to be an array since
Hi Dave,
I'm afraid this can't be done from MacRuby at the moment, and that the
Objective-C wrapper is the best solution so far.
However, if this is a common OpenGL function, maybe we need to find a solution
for 1.0… consider filing a ticket.
Laurent
On Jan 10, 2011, at 5:42 AM, Dave Baldwin
Assuming your array contains ASCII fixnum representation of characters,
messaging #pack('c*') on it should give you a string object back.
You can look up the documentation of Array#pack for more information.
I dislike this method, but here I don't see a better choice.
Laurent
On Jan 10, 2011,
On 2011-01-10, at 19:19 , Laurent Sansonetti wrote:
>
> Assuming your array contains ASCII fixnum representation of characters,
> messaging #pack('c*') on it should give you a string object back.
>
> I dislike this method, but here I don't see a better choice.
numbers = [65, 195, 169]
s = numbe
On Jan 10, 2011, at 1:22 PM, Caio Chassot wrote:
> On 2011-01-10, at 19:19 , Laurent Sansonetti wrote:
>>
>> Assuming your array contains ASCII fixnum representation of characters,
>> messaging #pack('c*') on it should give you a string object back.
>>
>> I dislike this method, but here I don't
On Jan 10, 2011, at 9:19 PM, Laurent Sansonetti wrote:
> Assuming your array contains ASCII fixnum representation of characters,
> messaging #pack('c*') on it should give you a string object back.
Do you mean something like [-188,-185,-186].#pack('c*') ?
> You can look up the documentation of
On 11/01/2011, at 10:29 AM, Joel Reymont wrote:
> How do I lookup documentation?
In your terminal
ri Array#pack
or Google.
Henry
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/mac
I use Fragaria (https://github.com/mugginsoft/Fragaria) in Leonhard
(https://github.com/glejeune/Leonhard)
Greg
Envoyé de mon iPhone
Le 10 janv. 2011 à 19:00, Joel Reymont a écrit :
> Is there anything I can piggyback on to implement syntax highlighting in a
> Cocoa editing window?
>
> Is t
Hi,
I've just released a fork of the Bacon spec library for MacRuby. It
specifically differs in the fact that it is NSRunloop aware, which is most
visible in the `wait' method that allows you to schedule a block of assertions
for later on the runloop. To be clear, the main thread is never halte
How do I combine compilation with macrubyc and xcode?
I would like to use macrubyc in the Release configuration, to avoid
distributing Ruby source code files.
Thanks, Joel
---
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
___
Build the Compile target. The target calls the macruby_deploy command-line
tool, which calls macrubyc for you. You can pass --help in the command-line for
more details.
Laurent
On Jan 10, 2011, at 3:51 PM, Joel Reymont wrote:
> How do I combine compilation with macrubyc and xcode?
>
> I would
26 matches
Mail list logo