Re: [gtk-list] Re: gtktext and other stuff




I have been working on a editor using gtk. I got to the point where
I need to use gtktext and found out how broken it is. I was going 
through its internals, and found out how little I understood of the
gdk.

If you need someone to test the widget, I have a ready made app in the
alpha stages to drop the widget in.

> 
> Arun,
>   I started working on the Text widget last week.  I've already got it
> editing, and I'm now working on line cache pruning.  The best way to
> do the scrollbars is to write a container widget which contains the text
> widget, and two scrollbars.  It's important to do it this way because you
> can directly control the size request, eliminating those "all the way up
> the container chain" resizes when you hide the scrollbar.  

I agree on the approach you suggested. 

> 
>   I have run into a few problems with the background pixmap
> implimentation.  When a line changes size, or you hit "enter", the lines
> below are moved down with a gdk_draw_pixmap.  Background pixmaps are
> handled specially for the text widget, with it's own pixmap tileing
> routine.  This is done so the pixmap will scroll with the text, instead of
> the text scrolling over a fixed pixmap.  This works until you want to
> reduce flickering and redraws using the pixmap drawing, destroying the
> tileing.  However, this whole technique leaves somthing to be desired.  I
> think the best thing to do is replace this code.  By creating a extra
> parent window, the text window can be allocated exatly one tile wider and
> longer than the displayed size, and placed inside the parent window.  Then
> a background pixmap can be set for the window, and a combination of
> gdk_window_move(s) and gdk_draw_pixmap(s) can be used to scroll with the
> same effect.  I think it would probably even be faster, and less work to
> code.
> 




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