Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Cursor position in a Gtk::TextBuffer

Reply
Thread Tools

Cursor position in a Gtk::TextBuffer

 
 
WoodHacker
Guest
Posts: n/a
 
      11-15-2006
I have not had great luck asking Gtk questions on this site, but I
don't know where else to turn....

I am writing my own editor and want to have syntax coloring. I scan
the file and sets tags to get what I want and it works fine for an
existing file. However, I need also to be able to add text to the
file and to create new files and have the coloring work as I type.
My question is, how do I get the number of the line I'm on? This will
allow me to get the iterator of that line and allow me to color the
line as I type. I can get the line from the window coordinates, but
how do I get the window coordinates? I can get them from the cursor
position, but how do I get the cursor position? How do I tell where I
am in the text buffer? The signal "changed" does not seem to return
an event structure that would allow me to get event.x and event.y.

Obviously, I'm not the first person who's had this problem, and I'm
sure I'm missing something, but as of right now I'm lost.

Bill

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to tell if cursor is sqlite.Cursor or psycopg2.Cursor dmaziuk Python 3 01-25-2011 04:52 AM
Declare Cursor error while implementing SCROLL CURSOR invy C Programming 4 12-28-2006 02:35 PM
Changing DEFAULT cursor to WAIT cursor in ASP =?Utf-8?B?VG9tYXMgS2VwaWM=?= ASP .Net 1 04-05-2005 07:42 PM
Insert text at cursor position Matt Tapia ASP .Net 1 11-26-2003 11:20 PM
OT: Position Mouse Cursor in centre of screen Slarty Bartfast MCSE 11 10-08-2003 06:49 PM



Advertisments