Re: Got the solution was Re: [pygtk] A few quickies (IMPORTANT)

2000-11-06 Thread Hassan Aurag

Can't say I am not waiting.

It's a pity GtkText is so bad and your bindings are so easy to use.


 On 4 Nov 2000, Hassan Aurag wrote:
 
  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.
 
 This is one of the places where the new text widget, it is much easier to
 navigate through the text buffer using GtkTextIter objects.
 
 James.
 



-- 
--
--
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], [EMAIL PROTECTED], 
--
--

My nose feels like a bad Ronald Reagan movie ...
--


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



Got the solution was Re: [pygtk] A few quickies (IMPORTANT)

2000-11-03 Thread Hassan Aurag

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(0x, 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



Re: Got the solution was Re: [pygtk] A few quickies (IMPORTANT)

2000-11-03 Thread James Henstridge

On 4 Nov 2000, Hassan Aurag wrote:

 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.

This is one of the places where the new text widget, it is much easier to
navigate through the text buffer using GtkTextIter objects.

James.


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



[pygtk] A few quickies (IMPORTANT)

2000-11-02 Thread Hassan Aurag



 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.

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?

3-What is a GdkColor? How can I get red, white, black ... and turn it into a GdkColor?


Thanks a lot for reading thus far ;)
-- 
--
--
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]
--
--

Drew's Law of Highway Biology:
The first bug to hit a clean windshield lands directly in front
of your eyes.
--



Re: [pygtk] A few quickies (IMPORTANT)

2000-11-02 Thread James Henstridge

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(0x, 0, 0)

James.


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