Could you please tell me how to add an Application Toolbar and attach a function to it using GuiXT?

Please look at the "Pushbutton" documentation, and use the option Pushbutton (toolbar) ....