Displaying 6 results from an estimated 6 matches for "wx_init".
Did you mean:
fx_init
2007 Jan 06
0
[834] trunk/wxruby2/lib/wx/classes/icon.rb: Simpler test for non-existent icon files
...en to the
- # constructor. It raisees an error if no data has been set to the icon.
</del><ins>+ # non-existent file is given to the constructor; otherwise, wx Widgets
+ # just carries on with an empty icon, which may cause faults later
</ins><span class="cx"> wx_init = self.instance_method(:initialize)
</span><span class="cx"> define_method(:initialize) do | *args |
</span><del>- wx_init.bind(self).call(*args)
-
- # Zero-argument form allowed, for use with later copy_from_bitmap
- if args.length.nonzero? and not ok
-...
2007 Jul 19
0
[1120] trunk/wxruby2/lib/wx/classes/previewframe.rb: GC protection for Preview associated with PreviewFrame, fixing crashes
...sociated with it that must be
+ # protected from Ruby''s GC. However, there is no C++ method to access
+ # the Wx::PrintPreview (only a protected member), so instead we have
+ # to assign it to an instance variable so it is marked correctly when
+ # the frame displaying it is marked.
+ wx_init = self.instance_method(:initialize)
+ define_method(:initialize) do | *args |
+ wx_init.bind(self).call(*args)
+ @__preview = args[0]
+ end
+end
</ins></span></pre>
</div>
</div>
</body>
</html>
2007 Jan 05
0
[830] trunk/wxruby2/lib/wx/classes/icon.rb: Raise exception if bad icon is specified (eg incorrect file path)
...ass="lines">@@ -0,0 +1,15 @@
</span><ins>+class Wx::Icon
+ # Redefine the initialize method so it raises an exception if a
+ # bad argument - in particular, a non-existent file - is given to the
+ # constructor. It raisees an error if no data has been set to the icon.
+ wx_init = self.instance_method(:initialize)
+ define_method(:initialize) do | *args |
+ wx_init.bind(self).call(*args)
+
+ # Zero-argument form allowed, for use with later copy_from_bitmap
+ if args.length.nonzero? and not ok
+ Kernel.raise ArgumentError, "Invalid icon specified: #{args...
2006 Dec 28
0
[807] trunk/wxruby2/lib/wx/classes/colour.rb: Raise an exception if an invalid colour is specified (Feature #1286)
...="cx"> class Wx::Colour
</span><ins>+
+ # Redefine the initialize method so it raises an exception if an
+ # invalid colour value is given. This might be an unknown colour
+ # string (eg ''dark blue'') or out-of-bounds integer values (<0 or >255)
+ wx_init = self.instance_method(:initialize)
+ define_method(:initialize) do | *args |
+ begin
+ wx_init.bind(self).call(*args)
+ # Invalid integer values raise SWIG ''no matching func''
+ rescue ArgumentError
+ Kernel.raise ArgumentError, "Invalid colour values #{a...
2007 Jun 05
0
[1049] trunk/wxruby2/lib/wx/classes/bitmap.rb: Raise an exception if an invalid file path is passed to Bitmap ctor
.../span><span class="cx"> class Wx::Bitmap
</span><ins>+ # Redefine the initialize method so it raises an exception if a
+ # non-existent file is given to the constructor; otherwise, wx Widgets
+ # just carries on with an empty bitmap, which may cause faults later
+ wx_init = self.instance_method(:initialize)
+ define_method(:initialize) do | *args |
+ if args[0].kind_of? String
+ if not File.exist?( File.expand_path(args[0]) )
+ Kernel.raise(ArgumentError, "Bitmap file does not exist: #{args[0]}")
+ end
+ end
+ wx_init.bind(self)....
2007 Jun 01
0
[1044] trunk/wxruby2: Special memory management for Wx::Grid
...of the Grid object. This means that as long as the Grid is
+ # not garbage collected, the associated renderers will be marked in
+ # the GC mark phase and so preserved.
+ #
+ # For most classes we handle GC on the SWIG side but honestly it''d be
+ # a whole lot more messy coding...
+ wx_init = self.instance_method(:initialize)
+ define_method(:initialize) do | *args |
+ wx_init.bind(self).call(*args)
+
+ @__renderers = {}
+ @__editors = {}
+ end
+
+ wx_set_cell_renderer = self.instance_method(:set_cell_renderer)
+ define_method(:set_cell_renderer) do | row, col, rendr |...