Thread: gui windows x_X
View Single Post
  #2  
Old 03-17-2006, 11:37 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
PHP Code:
new GuiWindowCtrl("objectname")
{
  
extent = {14062};
  
position = {5050};

  
text "Window Title";

  new 
GuiButtonCtrl("buttonname")
  {
    
position = {624};
    
extent = {12832};

    
text "Button!";
  }

... will create a window, and a button inside of it. Child objects usually go inside the parent objects.

The following code will show you how to handle the event of a button being clicked:
PHP Code:
function buttonname.onAction()
{
  
// code

If you would rather some custom actions, you could do:
PHP Code:
thiso.catchEvent(this"onAction""newActionName"); 
... inside one of the new blocks, and then newActionName() would be called when the button is clicked, in the case of a button.

The first parameter passed to newActionName() would be the object of the button.
PHP Code:
function newActionName(obj)
{
  
// obj is the button that was clicked

You can also change parameters about an object later:
PHP Code:
with (controlname)
{
  
member value;

PHP Code:
controlname.member value
__________________
Skyld
Reply With Quote