I tried to use the quickly.widgets.text_editor class in a quickly project just now (as in one of the highlighted quickly tutorials) and got an import error. When I tried to inspect the quickly.widgets module I got an import error. Does quickly still include its own widgets? Does it still include the text_editor widget? There doesn't seem to be any coherent API documentation for quickly on the Ubuntu developers site! (Sorry if I'm just missing something obvious.) Thanks.
1 Answer
Sounds like you maybe don't have the quickly-widgets package installed.
sudo apt-get install quickly-widgets
Then, e.g. following this video http://www.youtube.com/watch?v=urwBBlYhaUU&feature=player_embedded, the imports seems to work fine.
As far as docs go, the best I could find is using pythons internal documentation system.
from quickly.widgets import text_editor
print text_editor.__doc__
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
-
Thanks trent. I somehow missed the fact that the widgets were a separate package. Once I installed it everything worked fine. Jul 18, 2012 at 1:19