Ok here is the deal:

The text showing weirdly is realted to font choice as I discovered today. Using fixed 
fonts corrected the problem.

It's weird as far as I am concerned but this is how it works.


As for the position part, it was my mistake as I also discovered today. I forgot to 
count
newlines when scrolling to that position.

Anyway, your answer helped track down the bug and understand the color part, so thanks 
a lot.



> On 3 Nov 2000, Hassan Aurag wrote:
> 
> >  Hi,
> > 
> >  I'm writing a tool for internal use. Anyway, I build up a GtkCTree
> > containing info and where to find that info in the file (the char
> > positions) on a text file that I display in a GtkText. 
> > 
> >  The goal is to be able to click on a tree node and "jump" to its place
> > in the text file. Grabbing the info and connecting to the selection
> > event goes normal, but there are some problems
> > 
> >  I know GtkText is going to die, but for it's the only one I can use.
> > Anyway, I'll shoot my quickies:
> > 
> > 1- For some unknown reason, insert_defaults(text) would change the
> > format of my text. Do you know why and how to prevent this? As far as I
> > guess, it has to do with empty spaces. And btw, there are no tabs in my
> > text file. I read the file using python and it prints ok (the read text)
> > on anything from terminal to emacs ... but not in the damn widget.
> 
> The other option would be to use the insert_text() method inherited from
> the GtkEditable interface.  It might work better for you.
> 
> > 
> > 2-When I use set_position (or the other one, can't remember) to jump, it
> > jumps ok for the top parts of the file but fails miserably later. I
> > think it may have to do with point 1. The crazy part is that it still
> > reports the correct position and when I print that part of the string on
> > Python nothing is wrong, but all is in the widget. Any help?
> 
> I don't know about this one.
> 
> > 
> > 3-What is a GdkColor? How can I get red, white, black ... and turn it
> > into a GdkColor?
> 
> A GdkColor represents a colour :).  You can create colours with a
> GdkColormap (such as the one returned by widget.get_colormap()).  You just
> call its alloc() method:
>   colour = cmap.alloc("red")
> or:
>   colour = cmap.alloc(0xffff, 0, 0)
> 
> James.
> 
> 
> _______________________________________________
> pygtk mailing list   [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
> 



-- 
------------------------------------------------------------------
------------------------------------------------------------------
Hassan Aurag
------------------------------------------------------------------
CAE Electronics Ltd     |       Universite de Montreal
System update specialist|       Centre de Recherches Mathematiques
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Maximum Linux Magazine  |       Universite de Montreal
Contributing Editor     |       Departement de Maths/Stat
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
EMAIL:  [EMAIL PROTECTED]
------------------------------------------------------------------
------------------------------------------------------------------

Most people deserve each other.
                -- Shirley
------------------------------------------------------------------


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to