/* Hyperlinks supported on textbuffers and textgrids */
case gestalt_HyperlinkInput:
return val == wintype_TextBuffer || val == wintype_TextGrid;
+
+ /* Mouse support present in textgrids */
+ case gestalt_MouseInput:
+ return val == wintype_TextGrid;
/* Unsupported capabilities */
- case gestalt_MouseInput:
case gestalt_Graphics:
case gestalt_DrawImage:
case gestalt_Sound:
{
VALID_WINDOW(win, return);
g_return_if_fail(win != NULL);
- g_return_if_fail(win->type == wintype_TextBuffer || win->type == wintype_TextGrid);
+ g_return_if_fail(win->type == wintype_TextGrid);
g_signal_handler_unblock(win->widget, win->button_press_event_handler);
}
{
VALID_WINDOW(win, return);
g_return_if_fail(win != NULL);
- g_return_if_fail(win->type == wintype_TextBuffer || win->type == wintype_TextGrid);
+ g_return_if_fail(win->type == wintype_TextGrid);
g_signal_handler_block(win->widget, win->button_press_event_handler);
}
ChimaraGlk *glk = CHIMARA_GLK(gtk_widget_get_ancestor(win->widget, CHIMARA_TYPE_GLK));
g_assert(glk);
- /* TODO: calculate coordinates in proper metric */
- event_throw(glk, evtype_MouseInput, win, event->x, event->y);
+ event_throw(glk, evtype_MouseInput, win, event->x/win->unit_width, event->y/win->unit_height);
return TRUE;
}
g_signal_handler_block(textview, win->shutdown_keypress_handler);
win->insert_text_handler = g_signal_connect_after( textbuffer, "insert-text", G_CALLBACK(after_window_insert_text), win );
g_signal_handler_block(textbuffer, win->insert_text_handler);
- win->button_press_event_handler = g_signal_connect( textview, "button-press-event", G_CALLBACK(on_window_button_press), win );
- g_signal_handler_block(textview, win->button_press_event_handler);
/* Create an editable tag to indicate uneditable parts of the window
(for line input) */