##
# @module    picture_button
# @brief     Button object with a picture
# @version   1.0
#

import gui

class Picture_Button:

    def __init__(self, x, y, image, name, callback=None):
        self.pos = (x, y)
        self.image = image
        self.name = name
        self.callback = callback
        self.gui_l_index = None

    def generate_gui_l(self, tag):
        gui_l = [gui.DL_COLOR_RGB(255, 255, 255)]
        gui_l.extend(self.image.generate_gui_l(tag, self.pos))
        return gui_l

    def get_callback(self):
        return self.callback

    def set_callback(self, callback):
        self.callback = callback

    def set_gui_l_index(self, index):
        self.gui_l_index = index
