Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    catch a canceled gui.InputDialog?

    PYTHON Development
    0
    4
    658
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 14/09/2015 at 06:06, xxxxxxxx wrote:

      Hi,

      I have an input dialog in my code to get a value:

      txtInput =  gui.InputDialog('range', '0-100')

      But I need to know when the user clicks on 'Cancel', to make sure I stop the script when that happens. Must be something with a boolean I assume? Does anyone know?

      Thanks!
      Hans Willem

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 14/09/2015 at 07:24, xxxxxxxx wrote:

        You get an empty string if the user left the input field blank or pressed cancel.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 14/09/2015 at 08:41, xxxxxxxx wrote:

          Hi,

          When the user cancels the string returns the preset I gave it in the code. That preset is very valuable to me so I'd rather keep it. Are there no other ways?

          Thanks!
          HW

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 14/09/2015 at 10:48, xxxxxxxx wrote:

            Oh right, I remember. Hm not as far as I know, you need to create your own dialog class.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post