64 lines
1.1 KiB
Python
64 lines
1.1 KiB
Python
# Bryan Schumaker (8/13/2010)
|
|
|
|
import gtk
|
|
import libsaria
|
|
|
|
# Lazy loaded modules
|
|
window = None
|
|
tabs = None
|
|
|
|
|
|
# Function override variables
|
|
get_main_tabs = None
|
|
get_window = None
|
|
|
|
|
|
# Global variables for some objects
|
|
main_window = None
|
|
main_tabs = None
|
|
|
|
|
|
def startup():
|
|
global gtk
|
|
import gtk
|
|
gtk.main()
|
|
|
|
def exit(widget, event):
|
|
gtk.main_quit()
|
|
|
|
|
|
def get_main_tabs_init():
|
|
global tabs
|
|
global get_main_tabs
|
|
global main_tabs
|
|
import tabs
|
|
main_tabs = tabs.Tabs()
|
|
main_tabs
|
|
get_main_tabs = get_main_tabs_always
|
|
return main_tabs
|
|
def get_main_tabs_always():
|
|
global main_tabs
|
|
return main_tabs
|
|
get_main_tabs = get_main_tabs_init
|
|
|
|
def add_tab(text, content):
|
|
tabs = get_main_tabs()
|
|
tabs.append_page(content, text)
|
|
|
|
|
|
def get_window_init(size):
|
|
global window
|
|
global get_window
|
|
global main_window
|
|
import window
|
|
main_window = window.Window(size)
|
|
main_window.add(get_main_tabs())
|
|
get_window = get_window_always
|
|
return main_window
|
|
def get_window_always(size=None):
|
|
global main_window
|
|
if size != None:
|
|
main_window.resize(size[0], size[1])
|
|
return main_window
|
|
get_window = get_window_init
|