search for: rb_yield

Displaying 8 results from an estimated 8 matches for "rb_yield".

Did you mean: r_yield
2007 Mar 21
4
Problem with PaintDC(MSW)
When implementing EVT_PAINT handlers in c++ the PaintDC object is constructed at the beginning of the function, and auto destructed at it''s end, which informs wxwidgets that "invalid regions in the window have been repainted". Under ruby, this is not the case and causes a stream of EVT_PAINT events to be sent to the given window (until one of PaintDC objects is destructed by
2006 May 02
1
Converting rb_protect + ruby_stop to pure Ruby
Hi, Within process.c, in the fork method, there''s this bit of code: if(rb_block_given_p()){ int status; rb_protect(rb_yield, Qundef, &status); ruby_stop(status); } I translated that as this: if block_given? status = 0 begin yield rescue Exception status = -1 # Any non-zero result is failure end exit(status) end Is there a way to get the actual status? The $? global isn'&...
2004 Oct 23
0
win32-ipc, with blocks (code review please)
...{ handles[i] = (HANDLE)NUM2UINT(RARRAY(arr)->ptr[i]); } dwWait = WaitForMultipleObjects(len,handles,fWaitAll,dwTimeOut); // Yield block if signalled and block is provided if((dwWait >= WAIT_OBJECT_0) && (dwWait < WAIT_OBJECT_0 + len)){ if(rb_block_given_p()){ rb_yield(klass); } return INT2NUM(dwWait - WAIT_OBJECT_0 + 1); // signalled } if((dwWait >= WAIT_ABANDONED_0) && (dwWait < WAIT_ABANDONED_0 + len)){ return INT2NUM(-(dwWait - WAIT_ABANDONED_0 + 1)); // an abandoned mutex } if(dwWait == WAIT_TIMEOUT){ return...
2004 Mar 13
0
Quick thought on win32-mmap
I suggest getting rid of the hash style arguments fior new() for this package. In this particular case, you already have a class and accessors, so you can just use the yield trick, e.g. rb_yield(self) if rb_block_given_p(). Thus you can do: mm = Mmap.new do |m| m.namespace = file m.swapfile = sfile m.size = 1024 end Looks just as nice, and is a lot less code on the C side of things. I only use the hash-style keys when I don''t feel like creating separate objects, or...
2006 Oct 22
0
[707] trunk/wxruby2/swig/classes/Window.i: Window-paint method now implemented in Ruby (Alex Fenton)
...nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp VALUE dcVal = SWIG_NewPointerObj((void *) &dc, SWIGTYPE_p_wxPaintDC, 0); -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp rb_yield(dcVal); -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp DATA_PTR(dcVal) = NULL; -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp } -&nbsp&nbsp&nbsp&nbs...
2008 Jan 17
1
wxSockets
Hello guys, Alright Alex..... I need a few tips on where to start. I know that I''m going to need to rewrite the wxSocket header files, in order to incorperate them into wxRuby. But some advice on stuff such as wxSocketClient::new/connect, where it takes a wxIPAddress, and so forth. I know they are pretty friviolous structures for holding information about Addresses in which to make
2008 Jan 21
0
Wx::GenericDirCtrl Segfault Crash
...m /usr/lib/ruby/site_ruby/1.8/i586-linux-gnu/wxruby2.so #5 0xb7e48ba0 in Init_heap () from /usr/lib/libruby.so.1.8 #6 0xb770086d in wxRubyApp::mark_iterate () from /usr/lib/ruby/site_ruby/1.8/i586-linux-gnu/wxruby2.so #7 0xb7e3e674 in rb_apply () from /usr/lib/libruby.so.1.8 #8 0xb7e3f7bf in rb_yield () from /usr/lib/libruby.so.1.8 #9 0xb7e4c081 in rb_hash_freeze () from /usr/lib/libruby.so.1.8 #10 0xb7e4c750 in rb_env_path_tainted () from /usr/lib/libruby.so.1.8 #11 0xb7e972d9 in st_foreach () from /usr/lib/libruby.so.1.8 #12 0xb7e4e1a0 in rb_hash_reject_bang () from /usr/lib/libruby.so.1.8 #...
2008 Jun 12
4
Background thread - entension code - switch contexts
Hi, I am using wxRuby 1.9.7 and Ruby 1.8.6. I have built an extension in C++ and used swig to load it into Ruby interpreter, which works great. The extension is an often long executing algorithm, and I''ve noticed that if I fork a new Ruby thread in button clicked event, and in this thread run the algorithm the application freezes for the time of execution. I have looked through the