Added line number display (also shows details of the current selection, if any).
[rox-edit.git] / AppRun
blobfea5fee6c9dc0fc075f1fdc23972bd2390c653db
1 #!/usr/bin/env python
3 import findrox; findrox.version(1, 9, 10) # XXX 11
5 import sys, os
6 import rox
7 from rox import g
9 __builtins__._ = rox.i18n.translation(os.path.join(rox.app_dir, 'Messages'))
11 g.rc_parse_string('style "edit-text-area" { GtkWidget::cursor-color = "#e00"\n'
12 'GtkWidget::cursor-aspect-ratio = 0.1}\n'
13 'style "edit-scrolled" { GtkScrolledWindow::scrollbar-spacing = 0}\n'
14 'class "GtkScrolledWindow" style : gtk "edit-scrolled"\n'
15 'class "GtkTextView" style : gtk "edit-text-area"\n')
17 # Load icons
18 factory = g.IconFactory()
19 for name in ['rox-diff']:
20 path = os.path.join(rox.app_dir, "images", name + ".png")
21 pixbuf = g.gdk.pixbuf_new_from_file(path)
22 if not pixbuf:
23 print >>sys.stderr, "Can't load stock icon '%s'" % name
24 g.stock_add([(name, name, 0, 0, "")])
25 factory.add(name, g.IconSet(pixbuf = pixbuf))
26 factory.add_default()
28 rox.setup_app_options('Edit')
30 # Register options...
31 import EditWindow
32 import diff
34 # All options must be registered by the time we get here
35 rox.app_options.notify()
37 if len(sys.argv) > 1:
38 for file in sys.argv[1:]:
39 try:
40 EditWindow.EditWindow(file)
41 except EditWindow.Abort:
42 pass
43 else:
44 EditWindow.EditWindow()
46 rox.mainloop()