ocarina/src/extra/gui.py

44 lines
683 B
Python

#! /usr/bin/python
# To change this template, choose Tools | Templates
# and open the template in the editor.
__author__="bjschuma"
__date__ ="$May 13, 2010 10:28:46 AM$"
global window
window = None
from ocarina import vars
import gtknodes
import xml
import xml.dom.minidom as xml
def load(path):
fin = open(path)
if fin == None:
return None
return xml.parse(fin)
def build():
global window
doc = load(vars.THEME)
if doc == None:
return
if window != None:
window.clear()
window.newContent(doc.firstChild)
else:
window = gtknodes.make(doc.firstChild)
def buildfile(file):
doc = load(file)
if doc == None:
return
return gtknodes.make(doc.firstChild)