[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtkmm
Subject:    Re: [gtkmm] Gnomemm 1.1.16
From:       Karl Nelson <kenelson () ece ! ucdavis ! edu>
Date:       2001-03-20 16:08:19
[Download RAW message or body]

> >
> >
> >These macros should expand to make for
> >
> >  void set_points(const CanvasPoints& p);
> >  CanvasPoints get_points() const;
> >
> > with implementation.  And at the same time we construct a property
> > file which contains the streaming system to allow...
> >
> >  CanvasLine *line=manage(new CanvasLine(group));
> >  line << points(p) << fill_color(Gdk_Color("red"))
> >       << arrow_shape_b(true) << arrow_shape_b(false);
> 
> I have some hesitation about using streams and traits in this way, because
> it is not analagous to STL's use of them for formatting. And even the STL is
> not very intuitive when it uses them. However, as long as we keep the
> set/get as well then I'm happy.

Well what is more preferable?

  1) ... 

    CanvasLine line;
    line.set("name",name,"points",p.gtkobj(),"color",color.gdkobj(),0)
  
  2) using set_ as running stream

    Canvas line;
    line.set_name(name).set_points(p).set_color(color);

  3) stream like

    Canvas line;
    line << name(name) << points(p) << color(color);

  4) ignore it.

    Canvas line;
    line.set_name(name);
    line.set_points(p);
    line.set_color(color);

Number 1 is unacceptable.  Number 2 is okay, but totally inconsitent 
with the rest of the kit.  Number 3 is weird but could be seperated,
but then we have long debated what streams should be used for.  The
best use of them is in the graphics side.

Gdk::window w;
  w << moveto(100,100) << color("red") << "hello there fred" 
    << line(200,200);

Which you can make a compelling argument this is a stream.
Number 4 is my perferred solution, but for some reason no one 
ever liked it.  

Read over my response to Carl.  And see if it gives you any workable
ideas.

--Karl

_______________________________________________
to unsubscribe or change your subscription parameters :
http://lists.sourceforge.net/lists/listinfo/gtkmm-main

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic