You get an OnDotChange! Everypony gets an OnDotChange!
This commit is contained in:
		
							parent
							
								
									b9c4e3c003
								
							
						
					
					
						commit
						e48933385e
					
				
							
								
								
									
										10
									
								
								label.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								label.go
									
									
									
									
									
								
							@ -48,13 +48,13 @@ func (this *Label) Dot () text.Dot {
 | 
			
		||||
	return this.box.Dot()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SetAlign sets the X and Y alignment of the label.
 | 
			
		||||
func (this *Label) SetAlign (x, y tomo.Align) {
 | 
			
		||||
	this.box.SetAttr(tomo.AAlign(x, y))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// OnDotChange specifies a function to be called when the text cursor or
 | 
			
		||||
// selection changes.
 | 
			
		||||
func (this *Label) OnDotChange (callback func ()) event.Cookie {
 | 
			
		||||
	return this.box.OnDotChange(callback)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SetAlign sets the X and Y alignment of the label.
 | 
			
		||||
func (this *Label) SetAlign (x, y tomo.Align) {
 | 
			
		||||
	this.box.SetAttr(tomo.AAlign(x, y))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -76,6 +76,12 @@ func (this *TextInput) Dot () text.Dot {
 | 
			
		||||
	return this.box.Dot()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// OnDotChange specifies a function to be called when the text cursor or
 | 
			
		||||
// selection changes.
 | 
			
		||||
func (this *TextInput) OnDotChange (callback func ()) event.Cookie {
 | 
			
		||||
	return this.box.OnDotChange(callback)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SetAlign sets the X and Y alignment of the text input.
 | 
			
		||||
func (this *TextInput) SetAlign (x, y tomo.Align) {
 | 
			
		||||
	this.box.SetAttr(tomo.AAlign(x, y))
 | 
			
		||||
@ -130,6 +136,8 @@ func (this *TextInput) Type (char rune) {
 | 
			
		||||
	this.box.SetText(string(this.text))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TODO: add up/down controls if this is a multiline input
 | 
			
		||||
 | 
			
		||||
func (this *TextInput) handleKeyDown (key input.Key, numpad bool) bool {
 | 
			
		||||
	dot       := this.Dot()
 | 
			
		||||
	modifiers := this.box.Window().Modifiers()
 | 
			
		||||
 | 
			
		||||
@ -47,6 +47,12 @@ func (this *TextView) Dot () text.Dot {
 | 
			
		||||
	return this.box.Dot()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// OnDotChange specifies a function to be called when the text cursor or
 | 
			
		||||
// selection changes.
 | 
			
		||||
func (this *TextView) OnDotChange (callback func ()) event.Cookie {
 | 
			
		||||
	return this.box.OnDotChange(callback)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SetAlign sets the X and Y alignment of the text view.
 | 
			
		||||
func (this *TextView) SetAlign (x, y tomo.Align) {
 | 
			
		||||
	this.box.SetAttr(tomo.AAlign(x, y))
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user