Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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
    • Recent
    • Tags
    • Users
    • Login

    Python menu Check

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 493 Views
    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 Offline
      Helper
      last edited by

      On 24/03/2014 at 12:23, xxxxxxxx wrote:

      I am adding menu items to a python created window using:

      self.MenuSubBegin("Set")
      		self.MenuAddString(10017,"Local&c&")
      		self.MenuSubEnd()
      		
      

      Trying to toggle the check mark on the menu I am using:

      self.MenuInitString(10017,True,False)
      

      Where in the documentation, False is where the check status goes. So false should be unchecked and true should be checked. I can not get the check to do anything.

      Am I setting this up wrong?

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

        On 24/03/2014 at 12:34, xxxxxxxx wrote:

        I can confirm your problem. Looks like a bug, I'll forward this to the devs. You'll need to
        flush the menu and re-build it.

        Best,
        -Niklas

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

          On 24/03/2014 at 12:35, xxxxxxxx wrote:

          Thanks!

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

            On 25/03/2014 at 00:49, xxxxxxxx wrote:

            The &c& always checks the entry. You have to rename or build a new menu. To check the menu remove the &c& and check it only with self.MenuInitString. If you need a check when the dialog opens use this function also in CreateLayout with checked=True. Hope this helps.

            Cheers, s_rath

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

              On 25/03/2014 at 01:11, xxxxxxxx wrote:

              Thanks for the info, Sebastian. That explains why my tests didn't work, either.

              import c4d
                
              class Dialog(c4d.gui.GeDialog) :
                
                  def CreateLayout(self) :
                      self.MenuSubBegin("File")
                      self.MenuAddString(1000, "Open ...")
                      self.MenuAddString(1001, "Save ...")
                      self.MenuAddString(1002, "Close")
                      self.MenuInitString(1001, False, False)
                      self.MenuInitString(1002, False, False)
                      self.MenuSubEnd()
                      self.MenuFinished()
                      
                      return True
                
                  def Command(self, id, msg) :
                      if id == 1000:
                          self.MenuInitString(1001, True, False)
                          self.MenuInitString(1002, True, False)
                          self.MenuFinished()
                      elif id == 1002:
                          self.MenuInitString(1001, False, False)
                          self.MenuInitString(1002, False, False)
                          self.MenuFinished()
                      return True
                
              dlg = Dialog()
              dlg.Open(c4d.DLG_TYPE_ASYNC)
              

              Best,
              -Niklas

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

                On 25/03/2014 at 08:49, xxxxxxxx wrote:

                Thanks for the help guys!

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