Re: Gnome::Canvas remarks



Roderich Schupp said:
I had to add
      use utf8;
    to the top of canvas-rich-text.pl.

didn't work for me.  then again, i copied the text straight from the C source,
so it may be encoded incorrectly.  and i may me missing the correct fonts.  if
somebody else could confirm this, i'll be happy to fix it in CVS.


(2) canvas-primitives.pl explicitly creates horizontal and vertical
    scrollbars, then layouts them and the canvas with the help
    of a 2x2 Gtk2::Table. Wouldn't it be easier to put the canvas
    into a Gtk2::ScrolledWindow? It even has the advantage to manage
"on-demand" scrollbars. I know that this was ported from an example in
the Gnome canvas C sources, but people (including me :) will probably
cut'n'paste from examples code "that works" - even if  there are better
solutions.

well, yeah, a ScrolledWindow would be easier.  but it would not illustrate how
to add your own scrollbars.  a ScrolledWindow doesn't give you access to the
unused space between the ends of the scrollbars, where the Gimp puts the
button that brings up the navigation popup; if you want fine control over
those bits, you have to do it by hand.

of course, grepping the source of that example app reveals no other
occurrences of Scroll...  would you like to write an example that illustrates
the Easy Way and the Hard Way, comparing and contrasting?  :-)


(3) Creating a new canvas item of type Foo (attached to canvas
    group $group) is done by

      $item = Gnome2::Canvas::Item->new($group, "Gnome2::Canvas::Foo", ...);

    That's the same way gtk-perl did this. But wouldn't

      $item = Gnome2::Canvas::Foo->new($group, ...);

    be more natural?

again, it was a straight port from the C API.  while the second syntax is
preferrable in general, canvas items are indeed special in that you can't
create them with the normal Glib::Object constructor --- they are not complete
without the $group parameter, which binds them to a particular GnomeCanvas
object.

it's not practical to support both ways of doing it; we must pick one or the
other.  i don't really care.  if more people than just you speak up in favor
of this, i'll change it.

/me waits


-- 
muppet <scott at asofyet dot org>





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