def make_menu(position,options,width,prompt=None): contents = [] if prompt: p = SurfWidget(typefaces.prepare_paragraph(prompt,width)) contents.append(p) contents.append(SpaceWidget(8)) for label,command in options: o = ChoiceWidget(label,command) contents.append(o) return TextFrame(position,contents,width)