+ Reply to Thread
Results 1 to 2 of 2

Thread: rs.Stringbox behavior on Cancel

  1. #1
    Super Moderator Mitch's Avatar
    Join Date
    May 2010
    Location
    Switzerland
    Posts
    286

    rs.Stringbox behavior on Cancel

    I would have thought that Stringbox would return None if you hit the cancel button. However, what I found is that it returns an empty string "", which is not None. Is this normal behavior? Its vbRhinoscript companion returns Null when you hit cancel.

    Python Code:
      import rhinoscriptsyntax as rs
      newName=rs.StringBox("Hit the cancel button","blabla","Stringbox")
      if newName is None: print "None returned"
      if newName == "": print "Empty string returned"
      else: print "Something is wrong"

    --Mitch

  2. #2
    Senior Member Steve Baer's Avatar
    Join Date
    Apr 2010
    Location
    Seattle
    Posts
    1,464
    Blog Entries
    19
    I'll change this function to return None in the case the user canceled. This will be fixed in next week's V5 beta. Are you just going through all of my dialogs and finding little bugs I haven't handled?

    -Steve

+ Reply to Thread

Posting Permissions

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