let win = GWindow.window ~title:"LablGtkSourceView test" ()
let vbox = GPack.vbox ~packing:win#add ()
+let source_buffer = GSourceView.source_buffer ~check_brackets:true ()
let source_view =
- GSourceView.source_view ~packing:vbox#add ~height:400 ~width:300
+ GSourceView.source_view
+ ~source_buffer
+ ~auto_indent:true ~insert_spaces_instead_of_tabs:true ~tabs_width:2
~show_line_numbers:true
+ ~margin:30 ~show_margin:true
+ ~smart_home_end:true
+ ~packing:vbox#add ~height:400 ~width:300
()
let _ =
ignore (win#connect#destroy (fun _ -> GMain.quit ()));
ignore (source_view#connect#move_cursor (fun _ _ ~extend ->
prerr_endline "move_cursor"));
ignore (source_view#connect#undo (fun _ -> prerr_endline "undo"));
- source_view#set_auto_indent true;
- source_view#set_insert_spaces_instead_of_tabs true;
- source_view#set_tabs_width 2;
- source_view#set_margin 30;
- source_view#set_show_margin true;
- source_view#set_smart_home_end true;
win#show ();
GMain.Main.main ()