diff options
| author | ppedrot | 2012-05-02 17:32:46 +0000 |
|---|---|---|
| committer | ppedrot | 2012-05-02 17:32:46 +0000 |
| commit | d7a2b59e79c79d13f0146c40076ff80835b3c49f (patch) | |
| tree | 9d92259da830942e78773032b255ade568ef58ea | |
| parent | fed7d0f693128ae2a7c19a519882f12f138d88b4 (diff) | |
Quick workaround to handle badly designed Sourceview package.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15270 85f007b7-540e-0410-9357-904b9bb8a0f7
| -rw-r--r-- | ide/undo.ml | 9 | ||||
| -rw-r--r-- | ide/undo.mli | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/ide/undo.ml b/ide/undo.ml index cb3f455d1e..9b33c11e5e 100644 --- a/ide/undo.ml +++ b/ide/undo.ml @@ -16,10 +16,12 @@ let neg act = match act with | Insert (s,i,l) -> Delete (s,i,l) | Delete (s,i,l) -> Insert (s,i,l) -class undoable_view (tv:GtkSourceView2_types.source_view Gtk.obj) = +type source_view = [ Gtk.text_view | `sourceview ] Gtk.obj + +class undoable_view (tv : source_view) = let undo_lock = ref true in object(self) - inherit GSourceView2.source_view tv as super + inherit GSourceView2.source_view (Gobject.unsafe_cast tv) as super val history = (Stack.create () : action Stack.t) val redo = (Queue.create () : action Queue.t) val nredo = (Stack.create () : action Stack.t) @@ -170,6 +172,7 @@ let undoable_view ?(source_buffer:GSourceView2.source_buffer option) ?draw_spac | None -> GtkSourceView2.SourceView.new_ () | Some buf -> GtkSourceView2.SourceView.new_with_buffer (Gobject.try_cast buf#as_buffer "GtkSourceBuffer") in + let w = Gobject.unsafe_cast w in Gobject.set_params (Gobject.try_cast w "GtkSourceView") pl; Gaux.may (GtkSourceView2.SourceView.set_draw_spaces w) draw_spaces; - ((new undoable_view w):undoable_view)))) + ((new undoable_view w) : undoable_view)))) diff --git a/ide/undo.mli b/ide/undo.mli index 03e2885cde..b6a59ba756 100644 --- a/ide/undo.mli +++ b/ide/undo.mli @@ -8,7 +8,9 @@ (* An undoable view class *) -class undoable_view : GtkSourceView2_types.source_view Gtk.obj -> +type source_view = [ Gtk.text_view | `sourceview ] Gtk.obj + +class undoable_view : source_view -> object inherit GSourceView2.source_view method undo : bool |
