Codebase list accerciser / a558149
Merge branch 'michaelweghorn/no_more_exception_on_textview_click' into 'master' interface_view: Drop manual click handler that runs into exception See merge request GNOME/accerciser!22 Samuel Thibault 1 year, 9 months ago
2 changed file(s) with 3 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
14291429 # bold formatting is 4.
14301430 self.label_end.set_markup(_('End: %d') % end)
14311431
1432 def _onTextViewPressed(self, widget, event):
1433 '''
1434 Update spin button in the case that the textview was clicked.
1435 Once the spin button's value changes, it's own callback fires which
1436 re-populates the attribute view.
1437
1438 @param widget: The widget that recived the click event,
1439 typically the text view.
1440 @type widget: gtk.Widget
1441 @param event: The click event.
1442 @type event: gtk.gdk.Event
1443 '''
1444 if event.button != 1:
1445 return
1446
1447 x, y = event.get_coords()
1448 x, y = self.text_view.window_to_buffer_coords(gtk.TextWindowType.WIDGET,
1449 int(x), int(y))
1450 iter = self.text_view.get_iter_at_location(x, y)
1451
1452 self.offset_spin.set_value(iter.get_offset())
1453
14541432 def _onTextCursorMove(self, text_buffer, param_spec):
14551433 '''
14561434 Update spinner when input cursor moves.
1457
1435 Once the spin button's value changes, it's own callback fires
1436 which re-populates the attribute view.
1437
14581438 @param text_buffer: The section's main text buffer.
14591439 @type text_buffer: gtk.TextBuffer
14601440 @param param_spec: Some gobject crud
25162516 <property name="can_focus">True</property>
25172517 <property name="editable">False</property>
25182518 <property name="accepts_tab">False</property>
2519 <signal name="button-press-event" handler="_onTextViewPressed" swapped="no"/>
25202519 <signal name="focus-in-event" handler="_onTextFocusChanged" swapped="no"/>
25212520 <signal name="focus-out-event" handler="_onTextFocusChanged" swapped="no"/>
25222521 </object>