Home | Trees | Indices | Help |
|
---|
|
1 # Copyright 2006 James Tauber and contributors 2 # Copyright 2009 Luke Kenneth Casson Leighton 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 16 from pyjamas import DOM 17 22 2729 ALIGN_BOTTOM = "bottom" 30 ALIGN_MIDDLE = "middle" 31 ALIGN_TOP = "top" 32 ALIGN_CENTER = "center" 33 ALIGN_LEFT = "left" 34 ALIGN_RIGHT = "right"353773 8139 """ use this to apply properties as a dictionary, e.g. 40 x = klass(..., StyleName='class-name') 41 will do: 42 x = klass(...) 43 x.setStyleName('class-name') 44 45 and: 46 x = klass(..., Size=("100%", "20px"), Visible=False) 47 will do: 48 x = klass(...) 49 x.setSize("100%", "20px") 50 x.setVisible(False) 51 """ 52 if kwargs: 53 k = kwargs.keys() 54 l = len(k) 55 i = -1 56 while i < l-1: 57 i += 1 58 prop = k[i] 59 fn = getattr(self, "set%s" % prop, None) 60 if fn: 61 args = kwargs[prop] 62 if isinstance(args, tuple): 63 fn(*args) 64 else: 65 fn(args)
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Jun 16 12:42:30 2010 | http://epydoc.sourceforge.net |