Sha256: 140e7a7db0512c268f2c138ac186205ed576e532197babdfb067df1edbd5f6bb
Contents?: true
Size: 1.4 KB
Versions: 9
Compression:
Stored size: 1.4 KB
Contents
### # wxRuby3 wxWidgets interface director # Copyright (c) M.J.N. Corino, The Netherlands ### module WXRuby3 class Director class TipProvider < Director def setup spec.gc_as_object spec.make_abstract 'wxTipProvider' spec.add_header_code <<~__HEREDOC // Custom subclass implementation. // Provides access to currentTip member. class wxRubyTipProvider : public wxTipProvider { public: wxRubyTipProvider(size_t currentTip=0) : wxTipProvider(currentTip) {} void SetCurrentTip(size_t currentTip) { m_currentTip = currentTip; } }; __HEREDOC # make Ruby director and wrappers use custom implementation spec.use_class_implementation('wxTipProvider', 'wxRubyTipProvider') # add setter to class wrapper spec.add_extend_code 'wxTipProvider', <<~__HEREDOC void SetCurrentTip(size_t currentTip) { wxRubyTipProvider* rtp = dynamic_cast<wxRubyTipProvider*> (self); if (rtp) rtp->SetCurrentTip(currentTip); } __HEREDOC spec.add_swig_code '%alias wxTipProvider::SetCurrentTip "current_tip=";' # make Ruby object responsible for returned C++ tip provider spec.new_object 'wxCreateFileTipProvider' super end end # class TipProvider end # class Director end # module WXRuby3
Version data entries
9 entries across 9 versions & 1 rubygems