Displaying 13 results from an estimated 13 matches for "rb_ary_new".
Did you mean:
rb_ary_new2
2005 Sep 10
2
Swig generates bad interface to GetTextExtent
Swig''s bad interface generation strikes again. get_text_extent called
with 1 argument maps to WindowDC''s _wrap_wxWindowDC_GetTextExtent__SWIG_0
Since this generates a wxFont that''s not initialized to nil it fails
when calling into wxWindows. Anyone have a suggestion?
2006 Nov 24
0
[756] trunk/wxruby2/swig: Moved one-shot typemaps for ListBox.get_selections into ListBox.i
...><span class="cx">
</span><span class="cx">
</span><ins>+// typemaps for GetSelections()
+%typemap(in,numinputs=0) (wxArrayInt& selections) (wxArrayInt tmp) {
+ $1 = &tmp;
+}
+
+%typemap(out) (wxArrayInt& selections) {
+ $result = rb_ary_new();
+ for (int i = 0; i < $1.GetCount(); i++)
+ {
+ rb_ary_push($result,INT2NUM( $1.Item(i) ) );
+ }
+}
+
+%typemap(argout) (wxArrayInt& selections) {
+ $result = rb_ary_new();
+ for (int i = 0; i < ($1)->GetCount(); i++)
+ {
+ rb_ary_push($result,INT2NUM( ($1)->Item(...
2005 Oct 06
9
Grid.GetTextExtent
Wow. Look what SWIG does to GetTextExtent in Grid.cpp:
void SwigDirector_wxGrid::GetTextExtent(wxString const &string, int *x,
int *y, int *descent, int *externalLeading, wxFont const *font) const {
...
if (swig_get_up()) {
wxWindow::GetTextExtent(string,x,y,descent,externalLeading,font);
return;
}
obj0 = rb_str_new2((const char *)(&string)->mb_str());
2007 Jan 05
0
[831] trunk/wxruby2: Use simple ruby Integers to represent TreeItemIds
...;nbsp          
</del><span class="cx">                 VALUE array = rb_ary_new();                        
</span><del>-      &...
2007 Aug 31
0
[ win32utils-Bugs-13560 ] Service dependencies has wierd string.
...ns
Service
e
Service
ce
I debugged service.c and service.h and found something wrong.
I modified the function "rb_get_dependencies" from service.h like following and it works fine.
static VALUE rb_get_dependencies(LPTSTR lpDependencies){
VALUE v_dependencies = rb_ary_new();
if(lpDependencies){
TCHAR* pszDepend = 0;
int i = 0;
pszDepend = &lpDependencies[i];
while(*pszDepend != 0){
rb_ary_push(v_dependencies, rb_str_new2(pszDepend));
//i += _tcslen(lpDependencies) + 1; <-- Original code
i += _...
2006 Nov 23
0
[752] trunk/wxruby2: Fix for Bug #6810: ListBox#get_selections should return an array of selections
...an><span class="lines">@@ -395,6 +395,16 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+%typemap(argout) (wxArrayInt& selections) {
+
+ $result = rb_ary_new();
+
+ for (int i = 0; i < ($1)->GetCount(); i++)
+ {
+ rb_ary_push($result,INT2NUM( ($1)->Item(i) ) );
+ }
+}
+
</ins><span class="cx"> ##############################################################
</span><span class="cx">
</span&...
2007 Mar 18
0
[895] branches/wxruby2/wxwidgets_282/swig/classes: Fix Window::GetChildren method for changes in 2.6 -> 2.8 API
...cx">
</span><span class="cx"> // Typemap for GetChildren - casts wxObjects to correct ruby wrappers
</span><del>-%typemap(out) wxList& {
</del><ins>+%typemap(out) wxWindowList& {
</ins><span class="cx"> $result = rb_ary_new();
</span><span class="cx">
</span><del>- wxNode *node = $1->GetFirst();
</del><ins>+ wxWindowListNode *node = $1->GetFirst();
</ins><span class="cx"> while (node)
</span><span class="cx"> {
</...
2006 Dec 20
0
[789] trunk/wxruby2/swig/classes/Window.i: Make GetChildren work (tho general fix for get_ruby_object still needed)
...+24,28 @@
</span><span class="cx">
</span><span class="cx"> %apply int * INOUT { int * x_INOUT, int * y_INOUT }
</span><span class="cx">
</span><ins>+// Typemap for GetChildren
+%typemap(out) wxList& {
+ $result = rb_ary_new();
+
+ wxNode *node = $1->GetFirst();
+ while (node)
+ {
+ wxObject *obj = node->GetData();
+ rb_ary_push($result, get_ruby_object(obj));
+ node = node->GetNext();
+ }
+}
+
+// general-purpose function used to return ruby wrappers around windows
+// whose type is not known in...
2007 Jun 23
0
[1063] trunk/wxruby2/swig/classes/EvtHandler.i: Add a public ''connect'' method for handling arbitary user-defined events
...ublic Ruby ''connect'' method
+%extend wxEvtHandler {
+ VALUE connect(int firstId, int lastId, wxEventType eventType)
+ {
+ VALUE func = rb_funcall(rb_cProc, rb_intern("new"), 0);
+ rb_global_variable(&callbacks);
+ if(callbacks == Qnil)
+ callbacks = rb_ary_new();
+ rb_ary_push(callbacks, func);
+
+ wxObject* userData = new wxRbCallback(func);
+ wxObjectEventFunction function =
+ (wxObjectEventFunction )&wxRbCallback::EventThunker;
+ self->Connect(firstId, lastId, eventType, function, userData);
+   &...
2006 Dec 23
0
[794] trunk/wxruby2: Fix get_ruby_object so it works with SWIG tracking, move find_window_xx
...="cx">
</span><del>-// Typemap for GetChildren
</del><ins>+// Typemap for GetChildren - casts wxObjects to correct ruby wrappers
</ins><span class="cx"> %typemap(out) wxList& {
</span><span class="cx"> $result = rb_ary_new();
</span><span class="cx">
</span><span class="lines">@@ -37,38 +36,57 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-// gen...
2007 May 29
0
[1035] trunk/wxruby2/swig/classes/EvtHandler.i: Removed a heap of redundant stuff that''s been #if 0''d for a while
...e)
-{
-
- wxEvtHandler *cppSelf = (wxEvtHandler *) 0 ;
- SWIG_ConvertPtr(self, (void **) &cppSelf, SWIGTYPE_p_wxEvtHandler, 1);
-
- VALUE func = rb_funcall(rb_cProc, rb_intern("new"), 0);
- rb_global_variable(&callbacks);
- if(callbacks == Qnil)
- callbacks = rb_ary_new();
- rb_ary_push(callbacks, func);
-
- wxObject* userData = new wxRbCallback(func);
- wxObjectEventFunction function =
- (wxObjectEventFunction )&wxRbCallback::EventThunker;
- (cppSelf)->Connect(firstId, lastId, eventType, function, userData);
-}
-
-static VALUE internal_...
2004 Jul 31
3
Bug in new_work_item
Hi all,
Windows 2000
Ruby 1.8.2 R7
VC++ 6.0
I noticed that if I try to call new_work_item and give
the task a name that already exists, I get a segfault:
C:\eclipse\workspace\win32-taskscheduler>ruby test.rb
"0.1.0"
test.rb:22:in `new_work_item'': NewWorkItem() function
failed (Win32::TaskSchedul
erError)
from test.rb:22
test.rb:22: [BUG] Segmentation fault
ruby
2007 Mar 22
0
[916] branches/wxruby2/wxwidgets_282: More Wx::AUI classes, event hooks and sample
...+ wxAUI_BUTTON_LEFT = 107,
+ wxAUI_BUTTON_RIGHT = 108,
+ wxAUI_BUTTON_UP = 109,
+ wxAUI_BUTTON_DOWN = 110,
+ wxAUI_BUTTON_CUSTOM1 = 201,
+ wxAUI_BUTTON_CUSTOM2 = 202,
+ wxAUI_BUTTON_CUSTOM3 = 203
+ };
+
+// for GetAllPanes
+%typemap(out) wxAuiPaneInfoArray & {
+ $result = rb_ary_new();
+
+ for (int i = 0; i < $1->GetCount(); i++)
+ {
+        wxAuiPaneInfo pi = $1->Item(i);
+        VALUE r_pi = SWIG_NewPointerObj(&pi, SWIGTYPE_p_wxAuiP...