# Path: pyglet_gui/gui.py
# class PopupMessage(Manager):
#     """A simple fire-and-forget manager."""
# 
#     def __init__(self, text="", window=None, batch=None, group=None,
#                  theme=None, on_escape=None, have_focus=False):
#         def on_ok(_):
#             if on_escape is not None:
#                 on_escape(self)
#             self.delete()
# 
#         button = FocusButton("Ok", on_press=on_ok)
#         Manager.__init__(self, content=Frame(VerticalContainer(
#                          [Label(text), button])),
#                          window=window, batch=batch, group=group,
#                          theme=theme, is_movable=True)
#         Manager.set_next_focus(self, 1)
# 
# Path: pyglet_gui/theme/theme.py
# class Theme(ScopedDict):
#     """
#     A theme is a scoped dictionary that
#     maps specific keys to specific templates.
#     It is initialized by a dictionary (json-like) and by a resource path.
#     It maps resources in the dictionary to resources in the path,
#     initializing the correct template accordingly.
#     """
#     def __init__(self, dictionary, resources_path):
#         ScopedDict.__init__(self, dictionary, None)
# 
#         self._parsers = [TextureParser(resources_path)]
# 
#         self.build(self, dictionary)
# 
#     def update(self, E=None, **F):
#         super(Theme, self).update(E, **F)
#         self.build(self, E)
# 
#     def build_element(self, key, value, target):
# 
#         for parser in self._parsers:
#             if parser.condition_fulfilled(key):
#                 target[key] = parser.parse_element(value)
#                 # we only parse one element by parser.
#                 # if it is parsed, we are done.
#                 return
# 
#         # if value is a non-parsed dict, we add a new depth
#         # and build against the new depth.
#         if isinstance(value, dict):
#             target[key] = ScopedDict(parent=target)
#             self.build(target[key], value)
#         else:
#             target[key] = value
# 
#     def build(self, target, input_dict):
#         """
#         The main function of theme. Called during initialization,
#         it crawls the input_dict and populates
#         'target' with templates built from the dict.
#         """
#         for key, value in input_dict.items():
#             self.build_element(key, value, target)


from setup import *
from pyglet_gui.gui import PopupMessage
from pyglet_gui.theme import Theme


theme = Theme({
    "font": "Lucida Grande",
    "font_size": 12,
    "font_size_small": 10,
    "gui_color": [255, 255, 255, 255],
    "disabled_color": [160, 160, 160, 255],
    "text_color": [255, 255, 255, 255],
    "focus_color": [255, 255, 255, 64],
    "button": {
        "down": {
            "focus": {
                "image": {
                    "source": "button-highlight.png",
                    "frame": [8, 6, 2, 2],
                    "padding": [18, 18, 8, 6]
                }
            },
            "image": {
                "source": "button-down.png",
                "frame": [6, 6, 3, 3],
                "padding": [12, 12, 4, 2]
            },
            "text_color": [0, 0, 0, 255]
        },
        "up": {

# Path: pyglet_gui/gui.py
# class PopupMessage(Manager):
#     """A simple fire-and-forget manager."""
# 
#     def __init__(self, text="", window=None, batch=None, group=None,
#                  theme=None, on_escape=None, have_focus=False):
#         def on_ok(_):
#             if on_escape is not None:
#                 on_escape(self)
#             self.delete()
# 
#         button = FocusButton("Ok", on_press=on_ok)
#         Manager.__init__(self, content=Frame(VerticalContainer(
#                          [Label(text), button])),
#                          window=window, batch=batch, group=group,
#                          theme=theme, is_movable=True)
#         Manager.set_next_focus(self, 1)
# 
# Path: pyglet_gui/theme/theme.py
# class Theme(ScopedDict):
#     """
#     A theme is a scoped dictionary that
#     maps specific keys to specific templates.
#     It is initialized by a dictionary (json-like) and by a resource path.
#     It maps resources in the dictionary to resources in the path,
#     initializing the correct template accordingly.
#     """
#     def __init__(self, dictionary, resources_path):
#         ScopedDict.__init__(self, dictionary, None)
# 
#         self._parsers = [TextureParser(resources_path)]
# 
#         self.build(self, dictionary)
# 
#     def update(self, E=None, **F):
#         super(Theme, self).update(E, **F)
#         self.build(self, E)
# 
#     def build_element(self, key, value, target):
# 
#         for parser in self._parsers:
#             if parser.condition_fulfilled(key):
#                 target[key] = parser.parse_element(value)
#                 # we only parse one element by parser.
#                 # if it is parsed, we are done.
#                 return
# 
#         # if value is a non-parsed dict, we add a new depth
#         # and build against the new depth.
#         if isinstance(value, dict):
#             target[key] = ScopedDict(parent=target)
#             self.build(target[key], value)
#         else:
#             target[key] = value
# 
#     def build(self, target, input_dict):
#         """
#         The main function of theme. Called during initialization,
#         it crawls the input_dict and populates
#         'target' with templates built from the dict.
#         """
#         for key, value in input_dict.items():
#             self.build_element(key, value, target)


# Path: examples/popup_message.py
from setup import *
from pyglet_gui.gui import PopupMessage
from pyglet_gui.theme import Theme



theme = Theme({
    "font": "Lucida Grande",
    "font_size": 12,
    "font_size_small": 10,
    "gui_color": [255, 255, 255, 255],
    "disabled_color": [160, 160, 160, 255],
    "text_color": [255, 255, 255, 255],
    "focus_color": [255, 255, 255, 64],
    "button": {
        "down": {
            "focus": {
                "image": {
                    "source": "button-highlight.png",
                    "frame": [8, 6, 2, 2],
                    "padding": [18, 18, 8, 6]
                }
            },
            "image": {
                "source": "button-down.png",
                "frame": [6, 6, 3, 3],
                "padding": [12, 12, 4, 2]
            },
            "text_color": [0, 0, 0, 255]
        },
        "up": {

            "focus": {