redesign dialog loop message function
add resize dialog features

Signed-off-by: Kostja Stern <KostjaStern@gmail.com>