def test():
    const.set_path(Sloppy.__path__[0])
    filename = const.internal_path(const.PATH_EXAMPLE, 'example.spj')
    app = application.GtkApplication(filename)
    plot = app.project.get_plot(0)
    win = LayerWindow(app, plot)
    win.show()
    gtk.main()
Пример #2
0
def test2():
    const.set_path(Sloppy.__path__[0])
    filename = const.internal_path(const.PATH_EXAMPLE, 'example.spj')
    app = application.GtkApplication(filename)
    plot = app.project.get_plot(0)

    win = ToolWindow(app, app.project)
    win.connect("destroy", gtk.main_quit)

    win.show()
    gtk.main()
            
        result = dialog.run()
        dialog.destroy()

        return result == gtk.RESPONSE_YES


    def error_message(self, msg):
        dialog = gtk.MessageDialog(type=gtk.MESSAGE_ERROR,
                                   buttons=gtk.BUTTONS_OK,
                                   message_format=unicode(msg))
        dialog.run()
        dialog.destroy()




# ======================================================================    

def main(filename):
    filename = filename or const.internal_path(const.PATH_EXAMPLE, 'example.spj')
    app = GtkApplication(filename)
    gtk.main()

    
if __name__ == "__main__":
    const.set_path(Sloppy.__path__[0])
    main()