implemented paint on custom widget