text widget implementation