GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Oct 25, 2014 5:29 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Cursor keyboard
PostPosted: Wed Apr 02, 2008 3:02 am 
Offline
Familiar Face

Joined: Wed Apr 02, 2008 1:54 am
Posts: 5
I would like to know how I can get the position (x, y) of cursor keyboard.

For example the cursor a text editor


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 02, 2008 4:52 am 
Offline
GTK+ Guru

Joined: Tue Feb 05, 2008 8:39 am
Posts: 130
Mouse cursor or edit caret?
In case of GtkTextView caret it looks like:
Code:
void get_caret_coords(GtkTextView *textview, gint *x, gint *y)
{
  GtkTextBuffer *buffer = gtk_text_view_get_buffer(textview);
  GtkTextIter iter, iter_;
  gtk_text_buffer_get_selection_bounds(buffer, &iter, &iter_);
  *y=gtk_text_iter_get_line(&iter);
  *x=gtk_text_iter_get_line_offset(&iter)
}
[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 02, 2008 11:24 am 
Offline
Familiar Face

Joined: Wed Apr 02, 2008 1:54 am
Posts: 5
This function see the edit caret outside your aplication?

For example the position of 'edit caret' of some aplication of OpenOffice?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 02, 2008 11:35 am 
Offline
GTK+ Guru

Joined: Tue Feb 05, 2008 8:39 am
Posts: 130
No. It doesn't of course


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 02, 2008 3:08 pm 
Offline
Familiar Face

Joined: Wed Apr 02, 2008 1:54 am
Posts: 5
There is no possibility that I achieve that?

And for a level lower than the gtk?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 04, 2008 4:00 am 
Offline
Familiar Face

Joined: Wed Apr 02, 2008 1:54 am
Posts: 5
For me interact with the'OpenOffice', to know the position of 'caret cursor'... Is posible?

Is this to a software 'assistive'. With a position(x,y) of 'caret cursor' .
I can doing me 'Zoom Screen'. Monitor the events of keyboard


Top
 Profile  
 
 Post subject: GTK+ Tutorial
PostPosted: Fri Apr 04, 2008 7:44 pm 
Offline
Familiar Face

Joined: Mon Aug 20, 2007 8:52 pm
Posts: 8
GTK+ Tutorial

Look at this excellent tutorial for the answer for your question.
http://www.zetcode.com/tutorials/gtktutorial/gtktextview/

This is the link for the full version of that excellent GTK+ Tutorial (Better than some book)
http://www.zetcode.com/tutorials/gtktutorial/

Subair


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group