Have you ever seen vim's popup menu?
a little example about popup menu, for vim 
Tags: vim, popup, menu