66

I've downloaded an editor of sublimetext and I want to know what GUI library is used in there.

The filenames of files that are in the editor executables directory are:

bz2.pyd
Microsoft.VC90.CRT.manifest   
msvcp90.dll
msvcr90.dll                   
PackageSetup.py
PackageSetup.pyc              
pyexpat.pyd                   
python26.dll
python26.zip                  
select.pyd
sublimeplugin.py              
sublimeplugin.pyc
sublimetext.exe               
unicodedata.pyd
unins000.dat                  
unins000.exe
_ctypes.pyd                   
_elementtree.pyd
_hashlib.pyd                  
_socket.pyd
_ssl.pyd     

Can I find the information from the file names?

marcio
  • 10,002
  • 11
  • 54
  • 83
Freewind
  • 193,756
  • 157
  • 432
  • 708

3 Answers3

138

Sublime Text 2 is mostly coded in C++ and uses a custom UI toolkit. Here is the author, Jon Skinner, explaining it: http://news.ycombinator.com/item?id=2822114.

I keep meaning to write a blog post with some details on this, but as with many things, I usually end up coding instead. Sublime Text 2 is almost entirely C++ (with a smattering of Objective C for Cocoa and Python for plugins). Coding is generally fairly straight forward: code on one platform (mostly Linux at the moment, but I switch around frequently), and then make sure it still compiles elsewhere. Sublime Text 2 itself uses a custom UI toolkit. There are a lot of apps where this may not make sense, but it's not such an unreasonable choice for Sublime Text, where I always knew that a lot of the UI controls were going to have to be custom no matter the toolkit (e.g., the text control and tab controls). The UI toolkit sits on top of a cross platform abstraction layer, which is more a union of platform functionality rather than lowest common denominator.

jcomeau_ictx
  • 37,688
  • 6
  • 92
  • 107
Hugo
  • 2,569
  • 1
  • 19
  • 18
  • Looks like that link no longer exists (404 Not Found) – Greg Mar 12 '13 at 13:56
  • 13
    From the author of Sublime 2: _"Sublime Text 2 itself uses a custom UI toolkit"_, we know it is a custom UI. And, based on the Sublime 2 libs and error messages, we can gather the _"custom UI"_ is based on GTK (at least in part). – 2Toad Jun 01 '13 at 18:20
  • 1
    Do you, guys, think that that _"custom UI"_ is hardware accelerated (OpenGL), or not? – cubuspl42 Nov 20 '14 at 14:48
  • Some post stated that he was using Direct2D on windows. Can't find the link now. –  Jun 26 '16 at 22:02
  • 2
    A few weeks ago I read on HackerNews (I think it was in the Sublime Merge release announcement) that the custom UI toolkit is based on [Skia](https://skia.org/). – balu Oct 07 '18 at 04:47
29

a little Googling suggested it is using the Sublime GUI, which judging by the Debian source package is written in C++.

then again, running strings on the Linux sublime_text binary shows the following shared libraries (equivalent of Windows DLLs) which might suggest gtk:

/lib/ld-linux.so.2
libgtk-x11-2.0.so.0
libgdk-x11-2.0.so.0
libatk-1.0.so.0
libgio-2.0.so.0
libpangoft2-1.0.so.0
libpangocairo-1.0.so.0
libgdk_pixbuf-2.0.so.0
libcairo.so.2
libpng12.so.0
libpango-1.0.so.0
libfreetype.so.6
libfontconfig.so.1
libgobject-2.0.so.0
libgmodule-2.0.so.0
libgthread-2.0.so.0
librt.so.1
libglib-2.0.so.0
libpthread.so.0
libdl.so.2
libutil.so.1
libm.so.6
libX11.so.6
libstdc++.so.6
libgcc_s.so.1
libc.so.6
libgio-2.0.so
libgio-2.0.so.0
module.so

this also suggests gtk.

jcomeau_ictx
  • 37,688
  • 6
  • 92
  • 107
16

It might not be written in Python. The reason you see Python code is users can write scripts/plugin in Pythons to extend Sublime Text. I suspect it is written in C++ with GTK as GUI toolkit.

jemeshsu
  • 1,784
  • 16
  • 14