/tutorial/vision/layout/align.e
Specman e | 41 lines | 28 code | 10 blank | 3 comment | 0 complexity | d5f972e78f91af80b8bd976d9de1a29f MD5 | raw file
1class ALIGN 2-- 3-- This example show how to use ALIGNABLE_LABEL. 4-- 5 6inherit 7 GRAPHIC 8 9creation {ANY} 10 make 11 12feature {} 13 toplevel_window: TOPLEVEL_WINDOW 14 15 make is 16 local 17 alignable_label: ALIGNABLE_LABEL; button: BUTTON 18 do 19 create toplevel_window 20 toplevel_window.set_title("Align demo") 21 toplevel_window.set_background_color(white_color) 22 toplevel_window.map 23 24 create alignable_label.make(U"Text on the left") 25 alignable_label.set_alignment(left_alignment) 26 toplevel_window.child_attach(alignable_label) 27 28 create alignable_label.make(U"Text on the right") 29 alignable_label.set_alignment(right_alignment) 30 toplevel_window.child_attach(alignable_label) 31 32 toplevel_window.child_attach(create {HORIZONTAL_LINE}) 33 34 create button.with_label(toplevel_window, U"Exit") 35 button.when_left_clicked(agent vision.loop_stack.break) 36 37 vision.start 38 io.put_string("The end%N") 39 end 40 41end -- class ALIGN