Registers a method to be run when the gui is opened. Arguments passed through to method:
the gui that is opened
the trigger
the method to run