Я попытался использовать класс quick.widgets.text_editor в быстром проекте только сейчас (как в одном из выделенных быстрых учебников) и получил ошибку импорта. Когда я попытался проверить модуль quick.widgets, я получил ошибку импорта. Быстро ли по-прежнему включать свои собственные виджеты? Он все еще включает виджет text_editor? На сайте разработчиков Ubuntu, похоже, нет никакой понятной документации по API! (Извините, если я просто упускаю что-то очевидное.) Спасибо.
Похоже, у вас, возможно, не установлен пакет быстро-виджетов.
sudo apt-get install quickly-widgets
Затем, например, после этого видео http://www.youtube.com/watch?v=urwBBlYhaUU&feature=player_embedded импорт, кажется, работает нормально.
Что касается документации, лучшее, что я мог найти, - это использовать внутреннюю систему документации pythons.
from quickly.widgets import text_editor
print text_editor.__doc__
blockquote>Module for the TextView widgth wich encapsulates management of TextBuffer and TextIter for common functionality, such as cut, copy, paste, undo, redo, and highlighting of text. Using #create the TextEditor and set the text editor = TextEditor() editor.text = "Text to add to the editor" #use cut, works the same for copy, paste, undo, and redo def __handle_on_cut(self, widget, data=None): self.editor.cut() #add string to highlight self.editor.add_highlight("Ubuntu") self.editor.add_highlight("Quickly") #remove highlights self.editor.clear_highlight("Ubuntu") self.editor.clear_all_highlight() Configuring #Configure as a TextView self.editor.set_wrap_mode(Gtk.WRAP_CHAR) #Access the Gtk.TextBuffer if needed buffer = self.editor.get_buffer() Extending A TextEditor is Gtk.TextView