Displaying 17 results from an estimated 17 matches for "swig_newpointerobj".
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
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
...nst &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());
obj1 = SWIG_NewPointerObj(x, SWIGTYPE_p_int, 0);
result = rb_funcall(swig_get_self(), rb_intern("get_text_extent"),
2,obj0,obj1);
Wow. That''s just so wrong. It only converts two parameters and the one
it chooses to convert shouldn''t be passed in any case. Any suggestions
on this one?...
2006 Aug 15
0
Problem with directors and Ruby
...ndow::GetTextExtent(wxString const &string, int
*x, int *y, int *descent, int *externalLeading, wxFont const *font) const {
VALUE obj0 = Qnil ;
VALUE obj1 = Qnil ;
VALUE result;
if (swig_get_up()) {
wxWindow::GetTextExtent(string,x,y,descent,externalLeading,font);
return;
}
obj0 = SWIG_NewPointerObj(SWIG_as_voidptr(&string),
SWIGTYPE_p_wxString, 0 );
obj1 = SWIG_NewPointerObj(SWIG_as_voidptr(x), SWIGTYPE_p_int, 0 );
result = rb_funcall(swig_get_self(), rb_intern("GetTextExtent"),
2,obj0,obj1);
obj1 should be font and its type should be SWIGTYPE_p_wxFont. I''m usi...
2005 Aug 14
2
Object map
...ode and reading Swig
documentation to try to find out about tracking C objects back to Ruby
objects. It''s not so easy to do. I took at look at wxPython and their
source is a mess! I wasn''t able to glean anything from them on how they
do it. My current hypothesis is to trap SWIG_NewPointerObj calls and
build a map. But I haven''t traipsed through enough code yet to really
see if we can catch the Ruby objects dying. I note that no ruby object
owns the wxWindows objects as they''re created. I''m a little unsure how
all this works out still and whether garbag...
2006 Dec 23
0
[794] trunk/wxruby2: Fix get_ruby_object so it works with SWIG tracking, move find_window_xx
...ce - as in find_window, get_children etc
-
-// TODO - doesn''t work correctly with object tracking - it should return
-// the same Ruby object if the object has been seen before
-// use something like:
-//         returnVal = SWIG_NewPointerObj(obj, SWIGTYPE_p_wxWindow, 0);
-// but this causes problems for when a new Ruby object is needed - eg with XRC
</del><ins>+// Returns a ruby wrapper around a wxObject whose wx class is not known
+// in advance - needed for find_window, get_children etc This is a bit
+// complicated becau...
2007 Apr 29
0
[983] branches/wxruby2/wxwidgets_282: Make Window#paint work both inside and outside a paint event handler,
...nbsp        wxPaintDC dc(ptr);
</span><span class="cx">                 VALUE dcVal = SWIG_NewPointerObj((void *) &dc,SWIGTYPE_p_wxPaintDC, 0);
</span><span class="lines">@@ -161,6 +170,15 @@
</span><span class="cx">                &...
2007 Jan 05
0
[831] trunk/wxruby2: Use simple ruby Integers to represent TreeItemIds
...            
</span><del>-                VALUE ret_item_ruby = SWIG_NewPointerObj((new wxTreeItemId(static_cast< const wxTreeItemId& >(ret_item))), SWIGTYPE_p_wxTreeItemId, SWIG_POINTER_OWN | 0 );                   &am...
2005 Sep 26
0
Fixing class returns
...ook a stab at fixing the class returns tonight and I really didn''t
get anywhere. It seemed that using a %typemap(out) would do the trick,
according to the swig documentation, but it didn''t affect the warning
messages at all.
For example:
%typemap(out) wxPoint {
$result = SWIG_NewPointerObj((void *) &$1, SWIGTYPE_p_wxPoint, 1);
}
This doesn''t fix, for example, ScreenToClient in wxWindow.h. It''s
entirely likely I did something wrong. How are we supposed to fix these?
Roy
[707] trunk/wxruby2/swig/classes/Window.i: Window-paint method now implemented in Ruby (Alex Fenton)
2006 Oct 22
0
[707] trunk/wxruby2/swig/classes/Window.i: Window-paint method now implemented in Ruby (Alex Fenton)
...p;nbsp   {
-         wxPaintDC dc(ptr);
-        
-         VALUE dcVal = SWIG_NewPointerObj((void *) &dc, SWIGTYPE_p_wxPaintDC, 0);
-         rb_yield(dcVal);
-        
-         DATA_P...
2006 Dec 23
0
[797] trunk/wxruby2/swig/classes/TreeCtrl.i: Traverse method moved to wxSugar
...mp;nbsp   // create a copy to wrap and give to ruby
-        wxTreeItemId *copy_id = new wxTreeItemId(item_id.m_pItem);
-        VALUE rb_item_id = SWIG_NewPointerObj(copy_id, SWIGTYPE_p_wxTreeItemId, SWIG_POINTER_OWN);
-        rb_yield(rb_item_id);
- }
</del><span class="cx"> %}
</span><span class="cx"> %markfunc wxTreeCtrl "mark_wxTreeCtrl";...
2006 Dec 20
0
[789] trunk/wxruby2/swig/classes/Window.i: Make GetChildren work (tho general fix for get_ruby_object still needed)
...ce - as in find_window, get_children etc
+
+// TODO - doesn''t work correctly with object tracking - it should return
+// the same Ruby object if the object has been seen before
+// use something like:
+//         returnVal = SWIG_NewPointerObj(obj, SWIGTYPE_p_wxWindow, 0);
+// but this causes problems for when a new Ruby object is needed - eg with XRC
</ins><span class="cx"> %{
</span><del>-
</del><span class="cx"> static VALUE get_ruby_object(wxObject *obj)
</span><span cl...
2007 Mar 22
0
[910] branches/wxruby2/wxwidgets_282: Moved paint() method back into C++, so DC object is destroyed in timely
...;nbsp             wxPaintDC dc(ptr);
+                VALUE dcVal = SWIG_NewPointerObj((void *) &dc,SWIGTYPE_p_wxPaintDC, 0);
+                rb_yield(dcVal);
+          &am...
2006 Dec 05
0
[779] trunk/wxruby2: Added TreeCtrl#traverse method and documentation
...mp;nbsp   // create a copy to wrap and give to ruby
+        wxTreeItemId *copy_id = new wxTreeItemId(item_id.m_pItem);
+        VALUE rb_item_id = SWIG_NewPointerObj(copy_id, SWIGTYPE_p_wxTreeItemId, SWIG_POINTER_OWN);
+        rb_yield(rb_item_id);
+ }
</ins><span class="cx"> %}
</span><span class="cx"> %markfunc wxTreeCtrl "mark_wxTreeCtrl";...
2006 Nov 15
0
[740] trunk/wxruby2: API - Make ListCtrl#get_item return a ListCtrl item corresponding to a row and
...;nbsp
+        bool success = self->GetItem(*list_item);
+        if ( success )
+         returnVal = SWIG_NewPointerObj(list_item, SWIGTYPE_p_wxListItem, 1);
</ins><span class="cx">
</span><ins>+        return returnVal;
+ }
+}
+
+
+
</ins><span class="cx"> %import "include/wxObject.h"...
2008 Sep 12
7
embedding wxruby?
Hello,
is it possible to code a wxWidgets GUI in C++ and pass the whole wxApp or just single windows to embedded Ruby code? This would be very nice to provide a scriptable plugin system.
Greetings,
Niklas
_______________________________________________
wxruby-users mailing list
wxruby-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/wxruby-users
2007 Mar 22
0
[916] branches/wxruby2/wxwidgets_282: More Wx::AUI classes, event hooks and sample
...PaneInfoArray & {
+ $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_wxAuiPaneInfo, 0);
+        rb_ary_push($result, r_pi);
+ }
+}
+
</ins><span class="cx"> %import "include/wxEvtHandler.h"
</span><span class="cx"> %import "...