Re: subclass versus new_with_foo



On 24.08.2010 02:25, Kevin Ryde wrote:
Is it feasible to have some of those new_with_foo() methods follow the
class name?  An xs equivalent of maybe


   # sub new_with_buffer {
   #   my ($class, $textbuf) = @_;
   #   return Glib::Object::new ($class, buffer =>  $textbuf);
   # }

What if gtk_text_view_new_with_buffer some day changes such that it is not equivalent to this anymore?

What we could do, I guess, is to adjust the xsub for gtk_text_view_new_with_buffer such that it re-bless()-es the created object into the package name given as the first argument.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]