RE: GtkTextView getting coordinates (on Windows)



If I set the "motion_notify_event" for a GtkTextView (under 
windows), and
then move the mouse over that part of the screen, it does enter the
callback
function I provide, but when I call the function
(gtk_text_view_window_to_buffer_coords):
 GtkTextWindowType text_window_type = 0;
 text_window_type = 
gtk_text_view_get_window_type(GTK_TEXT_VIEW(widget),
event->window);
  gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW(widget),
text_window_type, pointer_x, pointer_y, &x, &y);
I get this error (repeated for each mouse motion over that window):
 11:37:46:Gtk: ** WARNING **  gtktextview.c:7315: can't get 
coords for
private windows
Any ideas why?

Presumably because (GtkTextWindowType)0 is GTK_TEXT_WINDOW_PRIVATE ?
See
http://developer.gnome.org/doc/API/2.0/gtk/GtkTextView.html#Gt
kTextWindowType

Ok, so why shouldn't it work Windows, when the same code works under Gnome
2?

Also can you tell me what the enumeration values actually mean and the
implications?

typedef enum
{
  GTK_TEXT_WINDOW_PRIVATE,
  GTK_TEXT_WINDOW_WIDGET,
  GTK_TEXT_WINDOW_TEXT,
  GTK_TEXT_WINDOW_LEFT,
  GTK_TEXT_WINDOW_RIGHT,
  GTK_TEXT_WINDOW_TOP,
  GTK_TEXT_WINDOW_BOTTOM
} GtkTextWindowType;


Regards,
Martyn



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]