2008-08-02 22:43:04 +00:00
|
|
|
-- This script shows a simple button and click event
|
|
|
|
|
|
|
|
-- Include our help script to load iup and take care of exit
|
2008-08-02 23:07:33 +00:00
|
|
|
require("auxlib");
|
2008-08-02 22:43:04 +00:00
|
|
|
|
|
|
|
function testiup()
|
|
|
|
-- Our callback function
|
|
|
|
function someAction(self, a) gui.text(10,10,"pressed me!"); end;
|
|
|
|
|
|
|
|
-- Create a button
|
|
|
|
myButton = iup.button{title="Button Textwtf"};
|
|
|
|
|
|
|
|
-- Set the callback
|
|
|
|
myButton.action = someAction;
|
|
|
|
|
|
|
|
-- Create the dialog
|
|
|
|
dialogs = dialogs + 1;
|
|
|
|
handles[dialogs] = iup.dialog{ myButton, title="IupDialog Title"; };
|
|
|
|
|
|
|
|
-- Show the dialog (the colon notation is equal
|
|
|
|
-- to calling handles[dialogs].show(handles[dialogs]); )
|
|
|
|
handles[dialogs]:show();
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2008-08-02 23:07:33 +00:00
|
|
|
testiup();
|
|
|
|
|
2008-08-02 22:43:04 +00:00
|
|
|
while (true) do -- prevent script from exiting
|
|
|
|
FCEU.frameadvance();
|
|
|
|
end;
|