GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cursor keyboard

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
drhachmann



Joined: 02 Apr 2008
Posts: 4

PostPosted: Wed Apr 02, 2008 3:02 am    Post subject: Cursor keyboard Reply with quote

I would like to know how I can get the position (x, y) of cursor keyboard.

For example the cursor a text editor
Back to top
Wolfgang
Familiar Face


Joined: 05 Feb 2008
Posts: 37

PostPosted: Wed Apr 02, 2008 4:52 am    Post subject: Reply with quote

Mouse cursor or edit caret?
In case of GtkTextView caret it looks like:
Code: (C)
1
2
3
4
5
6
7
8
9
10

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]
Back to top
drhachmann



Joined: 02 Apr 2008
Posts: 4

PostPosted: Wed Apr 02, 2008 11:24 am    Post subject: Reply with quote

This function see the edit caret outside your aplication?

For example the position of 'edit caret' of some aplication of OpenOffice?
Back to top
Wolfgang
Familiar Face


Joined: 05 Feb 2008
Posts: 37

PostPosted: Wed Apr 02, 2008 11:35 am    Post subject: Reply with quote

No. It doesn't of course
Back to top
drhachmann



Joined: 02 Apr 2008
Posts: 4

PostPosted: Wed Apr 02, 2008 3:08 pm    Post subject: Reply with quote

There is no possibility that I achieve that?

And for a level lower than the gtk?
Back to top
drhachmann



Joined: 02 Apr 2008
Posts: 4

PostPosted: Fri Apr 04, 2008 4:00 am    Post subject: Reply with quote

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
Back to top
subaren
Familiar Face


Joined: 20 Aug 2007
Posts: 8

PostPosted: Fri Apr 04, 2008 7:44 pm    Post subject: GTK+ Tutorial Reply with quote

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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP