Giter Site home page Giter Site logo

jonworms / lntextview Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 3.0 193 KB

Subclasses of NSRulerView and NSTextView for displaying line numbers as well as highlighting the current line. Similar to the behavior found in Xcode.

License: MIT License

Swift 97.55% Objective-C 2.45%

lntextview's Introduction

LNTextView

Screenshot

Installing:

You can either copy LNTextView.swift, LineHighlightingTextView.swift, and LineNumberView.swift into your project, or you can build and embed the LNTextView framework into your project. A release will come soon, at which time you should be able to use Carthage as well.

Example Usage:

With Storyboard:
//
//  ViewController.swift
//  Example
//
import Cocoa
import LNTextView

class ViewController: NSViewController {

	@IBOutlet var textView: LNTextView!

	override func viewDidLoad() {
		super.viewDidLoad()

		// Set a color theme:
		textView.textBackgroundColor = NSColor(calibratedRed: CGFloat(29.0/255.0), green: CGFloat(32.0/255.0), blue: CGFloat(35.0/255.0), alpha: 1)
		textView.lineNumbersBackgroundColor = NSColor(calibratedRed: CGFloat(54.0/255.0), green: CGFloat(56.0/255.0), blue: CGFloat(58.0/255.0), alpha: 1)
		textView.lineNumbersForegroundColor = NSColor.gray
		textView.selectionColor = NSColor(calibratedRed: 0.28, green: 0.30, blue: 0.32, alpha: 1)
		textView.currentLineColor = NSColor.white
		textView.textColor = NSColor.white
		// Do any additional setup after loading the view.
	}

}

lntextview's People

Contributors

jonworms avatar

Stargazers

Nick Berendsen avatar 哈尔滨吴彦祖 avatar 胡金友 avatar JTMWSM avatar Vasilis Akoinoglou avatar Kaunteya Suryawanshi avatar Daniel Walton avatar Tamim ziad avatar  avatar Mr.Sanchez avatar Mathias Quintero avatar Thiago Holanda avatar Heberti Almeida avatar Gianni Chiappetta avatar Joey Gentry avatar 竹莫袅 avatar Justin Bush avatar Serhii Londar avatar Astemir Eleev avatar Noah Tran avatar  avatar PanZhou avatar Jason Jobe avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.