Ejemplo n.º 1
0
def make_ok_cancel_box(elements,ok_text="Ok",cancel_text="Cancel"):
    ok = make_button(ok_text)
    ok.user_func = post_done
    #
    cancel = make_button(cancel_text)
    cancel.user_func = post_cancel
    #
##    ghost = Ghost(elements=[ok, cancel])
##    ghost.finish()
##    store(ghost, mode="h")
##    ghost.fit_children()
    ok_cancel = make_stored_ghost([ok,cancel])
    #
    linesize = max(e.get_family_rect().w for e in elements+[ok_cancel])
    line = Line.make(linesize, "h")
    #
    box = Box(elements=elements+[line,ok_cancel])
    box.finish()
    ok.user_params = {"el":box}
    cancel.user_params = {"el":box}
    return box
Ejemplo n.º 2
0
def make_ok_cancel_box(elements, ok_text="Ok", cancel_text="Cancel"):
    ok = make_button(ok_text)
    ok.user_func = post_done
    #
    cancel = make_button(cancel_text)
    cancel.user_func = post_cancel
    #
##    ghost = Ghost(elements=[ok, cancel])
##    ghost.finish()
##    thorpy.store(ghost, mode="h")
##    ghost.fit_children()
    ok_cancel = make_stored_ghost([ok,cancel])
    #
    linesize = max(e.get_family_rect().w for e in elements+[ok_cancel])
    line = Line.make(linesize, "h")
    #
    box = Box(elements=elements+[line,ok_cancel])
    ok.user_params = {"el":box}
    cancel.user_params = {"el":box}
    box.e_ok = ok
    box.e_cancel = cancel
    return box