Jump to content

guiSetProperty - LookNFeel


klaw

Recommended Posts

This example creates a button when the resource starts and defines a console command that toggles it between enabled (clickable) and disabled (not clickable).
 


function onStart()
  button = guiCreateButton( 20, 200, 150, 30, "Test", false )
end
addEventHandler( "onClientResourceStart", getResourceRootElement(), onStart )

function toogleButton()
  local currentState = guiGetProperty( button, "Disabled" )
  if currentState == "False" then
    guiSetProperty( button, "Disabled", "True" )
  else
    guiSetProperty( button, "Disabled", "False" )
  end
end
addCommandHandler( "togglebtn", toogleButton )

 

Link to comment
6 minutes ago, Dr.Marco said:

This example creates a button when the resource starts and defines a console command that toggles it between enabled (clickable) and disabled (not clickable).
 


function onStart()
  button = guiCreateButton( 20, 200, 150, 30, "Test", false )
end
addEventHandler( "onClientResourceStart", getResourceRootElement(), onStart )

function toogleButton()
  local currentState = guiGetProperty( button, "Disabled" )
  if currentState == "False" then
    guiSetProperty( button, "Disabled", "True" )
  else
    guiSetProperty( button, "Disabled", "False" )
  end
end
addCommandHandler( "togglebtn", toogleButton )

 

That didn't answer my question. I know how to use guiSetProperty. I'm asking about the property "LookNFeel". Not "Disabled".

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...