Re: GtkCanvas requirements?



2007/4/21, Gustavo J. A. M. Carneiro <gjc inescporto pt>:
  I can tell you the reasons why I usually use a canvas:

        1. Writing widgets is _very hard_ (when compared to e.g. canvas items).

Depends on your language (and on your widget of course). In python,
deriving a widget not a big deal. In C, well I guess you need to grasp
some concepts but it's hardly rocket sience.

In general, I think people are easily intimitated by the notion of
creating a new widget.They go "ooh, new widget, HARD!" and then go and
implement pretty much the same functionality by connecting to signals
and overriding them (which IMO results in uglier code, and is harder
to reuse), perhaps using even more effort than what it would take to
c&p some boilerplate code for a widget and doing it "properly". I
guess that's the price to pay for non-oo-native language :/

        2. Dynamically creating tons of widgets is costly, or at least I get
that impression, due to round-trips when creating gdk windows, or gdk
contexts, or whatever;

Most widgets don't have windows, so that shouldn't be a problem.
Per-widget (private) structures might be, but I doubt it would show up
significantly (unless we are literally talking about thousands of
them). The last option you give seems to imply that this is again a
case of "it MUST be costly, right?" rather than "look, it's costly
since <foo>!".

        3. The Gtk widget size negotiation protocol is not flexible enough;

That's true, although good things are under development currently (in SoC).

        4. Widgets cannot be printed to a PDF file or printer while preserving
full vectorial information (and no, taking a pixmap of a window and
printing that is certainly not good enough for quality publishing);

Shouldn't this be almost good with the printing API these days?

        5. Overlaying widgets and making translucent widgets is difficult or
impossible;

I hope we can work this one out (since it seems to be quite popular
demand, lord knows why ;), maybe GTK+ should have some support in
widget API for the composite extension / similar implementations for
other platforms?

        6. I want to make slightly interactive diagrams with a clearly
distinctive style from regular gtk widgets, namely i want to draw math
plots for later export into articles.  For this kind of content, users
don't want their selection of gtk theme to interfere with final content,
and the content should have white background and simple colors, none of
these gradients and 3d look that widgets have.

This is what I have thought as the main use of a canvas widget. This
thread indicates that people seem to want a lot more than that though.

--
Kalle Vahlman, zuh iki fi
Powered by http://movial.fi
Interesting stuff at http://syslog.movial.fi



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