Re: gtkextra and gtk+-2.0



Adrian Feiguin <feiguin magnet fsu edu> writes: 
> * Until now, gtksheet and gtkplot have been using a backing pixmap for all
> the drawing operations. I wonder how can I use the built-in double
> buffering in gtk-2.0 to enhance my widgets. How does it work? Any
> documentation? Hints? Advice? Some code to look at?

Look at the docs to gdk_window_begin_paint_region().

Basically you can just remove all the double buffering, and things
will not flicker. Really easy. A double buffer is automatically added
around all expose events. (And all drawing should be done in expose
events if you possibly can.)

> * gtkiconlist and gtksheet use gtkitementry, a gtkentry subclass that
> basically allows to align the text (centered, right, left). I wonder if
> gtkitementry could be replaced or enhanced using the gtkcelleditable and
> the gtkcell widgets. Do you think is a good idea? Is there any
> documentation avalilable about them, besides the API reference?

GtkCellRenderer is designed to be usable with a sheet type of widget -
I don't know if it's quite right for an icon list, but it might work
OK there too.

What you might really want for an icon list is an editable PangoLayout
- that is, unlike the entry, it would allow multiple lines of text,
but unlike TextView, it would only contain a single PangoLayout and be
relatively lightweight. Of course it'd be sort of tricky to implement,
but looking at GtkLabel and GtkEntry source code it probably wouldn't
be that hard. It'd just be a GtkLabel with editing, basically.

GtkEntry still doesn't have a text alignment feature, but there's an
open bug about it.

I don't know of docs other than the API reference, code comments, and
tests/*.c demos/*.c in the GTK distribution.

Havoc



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