# Bryan Schumaker (8/13/2010) import gtk import gobject import libsaria gobject.threads_init() # Lazy loaded modules window = None tabs = None box = None # Function override variables get_tabs = None get_window = None # Global variables for some objects main_window = None #main_tabs = None def startup(): global gtk import gtk libsaria.startup() gtk.main() def exit(widget, event): gtk.main_quit() libsaria.shutdown() def get_tabs_once(): global tabs global get_tabs import tabs tabs.init() get_tabs = get_tabs_rest return tabs.tabs def get_tabs_rest(): global tabs return tabs.tabs get_tabs = get_tabs_once def add_tab(text, content): global tabs tabs.append_page(content, text) def remove_tab(text): global tabs tabs.remove_page(text) def get_window_once(size): global window global get_window global main_window import window main_window = window.Window(size) main_window.add(get_tabs()) get_window = get_window_rest return main_window def get_window_rest(size=None): global main_window if size != None: main_window.resize(size[0], size[1]) return main_window get_window = get_window_once def set_window_title(text): window = get_window() window.set_title(text)