Пример #1
0
def show_tooltip(content, view=None, location=-1, timeout=0):
    '''
    Shows a tooltip.

    @content
      The tooltip's content (minihtml).

    @view
      The view in which the tooltip should be shown. If `None`, the active view
      will be used if available.

    @location
      Text location at which the tooltip will be shown.

    @timeout
      If greater than 0, the tooltip will be autohidden after @timeout
      milliseconds.
    '''
    if not view:
        try:
            view = sublime.active_window().active_view()
        except AttributeError as e:
            return
        else:
            if not view:
                return

    view.show_popup(content, location=location, max_width=500)

    if timeout > 0:
        current_id = next(id_generator)
        after(timeout, lambda: _hide(view, current_id))
Пример #2
0
def show_tooltip(content, view=None, location=-1, timeout=0):
    '''
    Shows a tooltip.

    @content
      The tooltip's content (minihtml).

    @view
      The view in which the tooltip should be shown. If `None`, the active view
      will be used if available.

    @location
      Text location at which the tooltip will be shown.

    @timeout
      If greater than 0, the tooltip will be autohidden after @timeout
      milliseconds.
    '''
    if not view:
        try:
            view = sublime.active_window().active_view()
        except AttributeError as e:
            return
        else:
            if not view:
                return

    view.show_popup(content, location=location, max_width=500)

    if timeout > 0:
        current_id = next(id_generator)
        after(timeout, lambda: _hide(view, current_id))
Пример #3
0
 def on_finished(self, proc):
     after(0, functools.partial(self.finish, proc))
Пример #4
0
 def on_data(self, proc, data):
     after(0, functools.partial(self.append_data, proc, data))