Displaying 12 results from an estimated 12 matches for "rb_ary_push".
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?
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());
2006 Nov 24
0
[756] trunk/wxruby2/swig: Moved one-shot typemaps for ListBox.get_selections into ListBox.i
...ot;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(i) ) );
+ }
+}
+// end typemaps for GetSelections()
+
</ins><...
2007 Feb 22
4
Ferret progress update
Hi folks,
Just thought I better let you all know that I''m still working on the
next release of Ferret. I''ve been working the last 7 days doing
nothing but Ferret development. The last iteration generated a diff of
almost 5000 lines so there are some pretty major changes. Most people
won''t notice these changes however as the API remains unchanged. But
if you were having
2007 Aug 31
0
[ win32utils-Bugs-13560 ] Service dependencies has wierd string.
...ice.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 += _tcslen(&(lpDependencies[i])) + 1; // <-- Modified code
pszDepend = &lpDependencies[i];
}
}
if(RARRAY(v_dependencies)->len == 0)...
2006 Nov 23
0
[752] trunk/wxruby2: Fix for Bug #6810: ListBox#get_selections should return an array of selections
...pan 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><span class="cx"> %typemap(in) wxEdge {
</span></span&...
2011 Aug 25
4
[PATCH 0/3] ruby: Fix event handler failure
I won't pretend I really understand what's going on here. I've CC'd
this message to Chris since he might have a better idea.
https://bugzilla.redhat.com/show_bug.cgi?id=733297
In this bug, it appears that the event log callback goes out of scope
and is garbage collected. (This is despite the fact we registered it
as a global root). When we invoke the callback later,
2006 Dec 20
0
[789] trunk/wxruby2/swig/classes/Window.i: Make GetChildren work (tho general fix for get_ruby_object still needed)
...NOUT { 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 advance - as in find_window, get_children etc
+
+// TODO - doesn''t work correctly with object tracking - it sho...
2007 Jun 23
0
[1063] trunk/wxruby2/swig/classes/EvtHandler.i: Add a public ''connect'' method for handling arbitary user-defined events
...9;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);
+     &nb...
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
...andler *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_evt_with_id(int argc...
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
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...pr " return rv;\n";
| RStringList _ ->
- pr " int i, len = 0;\n";
- pr " for (i = 0; r[i] != NULL; ++i) len++;\n";
- pr " VALUE rv = rb_ary_new2 (len);\n";
- pr " for (i = 0; r[i] != NULL; ++i) {\n";
- pr " rb_ary_push (rv, rb_str_new2 (r[i]));\n";
- pr " free (r[i]);\n";
- pr " }\n";
- pr " free (r);\n";
- pr " return rv;\n"
+ pr " int i, len = 0;\n";
+ pr " for (i = 0; r[i] != NULL; ++i) len++;\n";
+...