1. #1
    Senior Member User Gallery
    Join Date
    May 2007
    Location
    Raleigh NC
    Posts
    471

    Default Dynamically Changing IButton Name v2

    I am trying to change the name of a button after it has been clicked but I am running into some problems. I found this thread:

    http://www.zbrushcentral.com/showthr...tton-Text-quot

    and it was very helpful. HOWEVER.... it seems to only work in the tutorial menu? I got it to work in the tutorial menu but then I tried something similar to this within a scripted menu/plugin and it just duplicated the button.


    I have attached the script I am using this for. I am attempting to make a "Favorites" sort of thing where you can store commonly used tools. I have it basically working but I would love to have the "Store" button change its name right after you click it instead of when you restart ZB.

    The "RecentFiles_mem.txt" is the script with the code from the above link hacked in. It "works" as expected in the tutorial window but not in a menu.

    Any other comments are also welcome if you see I am doing something wrong. I am still pretty new to scripting but learning alot.

    RecentFiles_mem.txt

    RecentFiles.txt

  2. #2
    Moderator User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    8,315

    Default

    I don't think you can dynamically change plugin button names - at least, I've not found a way. In order to update a plugin interface you need to close it first and although you can do this through zscript it could lead to undesirable side effects if used often. And I've not been able to change plugin button names 'on the fly' using variables.

    I'm not sure what you are planning for your plugin but here's one adapted from one I use for zscripting that may give you some ideas. You can load any of ten previous loaded ztools (simply pressing enter after the list has appeared will load the most recent). As you must load the ztool through the plugin to store the name I've added a 'store' button.


    HTH,
    Attached Files Attached Files

  3. #3
    Senior Member User Gallery
    Join Date
    May 2007
    Location
    Raleigh NC
    Posts
    471

    Default

    Drat! Not what I was hoping for but thank you so much for letting me know.

    This script is very interesting. I didn't think about using a note interface! It's more complex than I had envisioned but it is very close to what I was thinking about doing. Hmmm....

    I am sure you'll see if I come up with anything

    Thanks again!
    Last edited by Nyx702; 04-11-12 at 04:47 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •