Button.enabled state

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  01 January 2008
Button.enabled state

Hi

I would like a menu with two items: a drop down list and a button.

Is it possible to have the button.enabled status change dynamically depending on what is currently selected from the drop down list?

My blind searching has stumbled into Callbacks, is this what I should be looking into?

Thanks
 
  01 January 2008
Originally Posted by MickyG: Hi

I would like a menu with two items: a drop down list and a button.

Is it possible to have the button.enabled status change dynamically depending on what is currently selected from the drop down list?

My blind searching has stumbled into Callbacks, is this what I should be looking into?

Thanks


In the event handler ON someDropDownList SELECTED itm DO (), you can set the state of the button based on the 'itm' value which will contain the index of the selection.

For example,


rollout test_rollout "Test"
 (
   dropdownlist ddl_test items:#("One","Two")
   button btn_test "Test Button" enabled:false
 
   on ddl_test selected itm do 
   (
 	btn_test.enabled = itm == 2
   )
   on btn_test pressed do print ddl_test.selection
 )--end rollout
 createDialog test_rollout 120 60



If you meant something else, please clarify.
__________________
Bobo
 
  01 January 2008
Thanks Bobo

I realised that if I want to call the button.enabled property outside the button pressed code, I have to first add the rollout name eg. rollout.button.enabled, not just button.enabled.

But your way also provides a working solution, so I will add it to my slowly-growing store of knowledge, with my thanks.
 
  01 January 2008
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 04:17 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.