- # and set attributes
- try:
- if attrib == 'position':
- guiObject.move(parsePosition(value))
- elif attrib == 'size':
- guiObject.resize(parseSize(value))
- elif attrib == 'title':
- guiObject.setTitle(value)
- elif attrib == 'text':
- guiObject.setText(value)
- elif attrib == 'font':
- guiObject.setFont(parseFont(value))
- elif attrib == "pixmap":
- ptr = gPixmapPtr()
- if loadPNG(ptr, value):
- raise "loading PNG failed!"
- x = ptr
- ptr = ptr.__deref__()
- print desktop
- desktop.makeCompatiblePixmap(ptr)
- guiObject.setPixmap(ptr)
-# guiObject.setPixmapFromFile(value)
- elif attrib == "valign":
- try:
- guiObject.setVAlign(
- { "top": guiObject.alignTop,
- "center": guiObject.alignCenter,
- "bottom": guiObject.alignBottom
- }[value])
- except KeyError:
- print "valign must be either top, center or bottom!"
- elif attrib == "halign":
+ skinAttributes.append((attrib, value))
+
+def applySingleAttribute(guiObject, desktop, attrib, value):
+ # and set attributes
+ try:
+ if attrib == 'position':
+ guiObject.move(parsePosition(value))
+ elif attrib == 'size':
+ guiObject.resize(parseSize(value))
+ elif attrib == 'title':
+ guiObject.setTitle(value)
+ elif attrib == 'text':
+ guiObject.setText(value)
+ elif attrib == 'font':
+ guiObject.setFont(parseFont(value))
+ elif attrib == "pixmap":
+ ptr = gPixmapPtr()
+ if loadPNG(ptr, value):
+ raise "loading PNG failed!"
+ x = ptr
+ ptr = ptr.__deref__()
+ desktop.makeCompatiblePixmap(ptr)
+ guiObject.setPixmap(ptr)
+ # guiObject.setPixmapFromFile(value)
+ elif attrib == "valign":
+ try:
+ guiObject.setVAlign(
+ { "top": guiObject.alignTop,
+ "center": guiObject.alignCenter,
+ "bottom": guiObject.alignBottom
+ }[value])
+ except KeyError:
+ print "valign must be either top, center or bottom!"
+ elif attrib == "halign":
+ try:
+ guiObject.setHAlign(
+ { "left": guiObject.alignLeft,
+ "center": guiObject.alignCenter,
+ "right": guiObject.alignRight,
+ "block": guiObject.alignBlock
+ }[value])
+ except KeyError:
+ print "halign must be either left, center, right or block!"
+ elif attrib == "flags":
+ flags = value.split(',')
+ for f in flags: