From: Takaaki T. <tt...@ja...> - 2001-08-17 17:19:31
|
At Fri, 17 Aug 2001 08:46:02 -0700, Kevin Smith <kev...@ho...> wrote: > > class RBFl_Xxxx : Fl_Xxxx { > > public: > > VALUE rb_object; > > .... > > } > > Exactly. I've tried to implement the above class, but some problems are found. if we implement classes RBFL_Xxxx and RBFL_Yyyy, RBFL_Yyyy is a subclass of the class RBFL_Xxxx, we obtain the following class hierarchy. Fl_Xxxxx -------> RBFL_Xxxxx | | V Fl_Yyyyy -------> RBFL_Yyyyy if ruby classes `Fltk::Xxxx' and `Fltk::Yyyy' wrap the C++ classes `RBFL_Xxxx' and `RBFL_Yyyy' respectively, the C++ class hierarchy is different from the Ruby class hierarchy. I think we had better write the class like this: class RBFl_Xxxx : Fl_Xxxx { public: VALUE rb_object; .... } class RBFl_Yyyy : public Fl_Yyyy, public RBFl_Xxxx { ... } class RBFl_Zzzz : public Fl_Zzzz, public RBFl_Yyyy { ... } > > and making the structure for the Ruby class, > > > > struct rb_fl_data { > > RBFl_Xxxxx *widget; > > } > > I'm not sure what we would store in *widget. Sorry, I mistook here. please forget that code. > One other note: I'm not really happy with RBFl_ as a prefix. I would much > prefer one of the following, as they seem more consistent: > 1. RBFL_Xxx > 2. RubyFltkXxx I use `RBFl_', since the Fltk uses `Fl_'. I prefer short name. how about `RBFLXxx'? -- Takaaki Tateishi <tt...@ja...> |