def create_lob(reg): print 'create lob in py' print dir(Font) print Font("Sans") #for i in Font.list(): print i.family row = Hbox([ Rect(Color(1,0,0)), Rect(Color(0,1,0)), Rect(Color(0,0,1)) ]) lob = Vbox([row, Rect(Color(.7, .8, .9)), Rect(Color(.4, .5, .6))]) fonts = Font.list() texts = [Vglue()] for f in fonts[3:15]: texts.append(Hbox([FontText(f, 12, "Hello!"), Hglue()])) texts.append(Vglue()) return Stack([Vbox(texts), lob])
def create_lob(reg): print 'create lob in py' color = Color(.9, .2, .5) print 'color', color shade = Shade( 1, 0, #[0., Color(.9, .2, .5), # 1., Color(.2, .5, .3)]) [ 0, c("58595b"), 0.22, c("a7a7a7"), 0.45, c("454547"), 0.60, c("fefefe"), 0.80, c("adadad"), 1, c("fafafa") ]) lob = RoundedRect(shade, 10., 20., 30., 40.) center = Margin( RoundedRect( Shade(1, 0, [ 0, c("58595b"), 0.60, c("fefefe"), 1, c("53525b"), ]), 40, 40, 40, 40), 10, 10, 10, 10) fonts = Font.list() texts = [Vglue()] texts.append( Hbox( [Hglue(), FontText(fonts[10], 30, "Button", c("000000")), Hglue()])) texts.append(Vglue()) lob = Stack([Vbox(texts), center, lob]) return lob
def create_lob(reg): print 'create lob in py' color = Color(.9, .2, .5) print 'color', color shade = Shade(1, 0, #[0., Color(.9, .2, .5), # 1., Color(.2, .5, .3)]) [0, c("58595b"), 0.22, c("a7a7a7"), 0.45, c("454547"), 0.60, c("fefefe"), 0.80, c("adadad"), 1, c("fafafa")]) lob = RoundedRect(shade, 10.,20.,30.,40.) center = Margin(RoundedRect(Shade(1,0, [0, c("58595b"), 0.60, c("fefefe"), 1, c("53525b"), ]), 40,40,40,40), 10,10,10,10) fonts = Font.list() texts = [Vglue()] texts.append(Hbox([Hglue(), FontText(fonts[10], 30, "Button", c("000000")), Hglue()])) texts.append(Vglue()) lob = Stack([Vbox(texts), center, lob]) return lob