Beispiel #1
0
def replace_context(ctx_getter):
    view = ctx_getter('textview-active')
    if view:
        if view in active_replace_widgets:
            return view
    else:
        window = ctx_getter('window')
        focused_widget = window.get_focus()
        for view, replace_widget in active_replace_widgets.iteritems():
            if widget_is_child_of(focused_widget, replace_widget):
                return view
Beispiel #2
0
def search_context(ctx_getter):
    view = ctx_getter('textview-active')
    if view:
        if (search_selections or view in active_search_widgets):
            return view
    else:
        window = ctx_getter('window')
        focused_widget = window.get_focus()
        for view, search_widget in active_search_widgets.iteritems():
            if widget_is_child_of(focused_widget, search_widget):
                return view