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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    GetWidth() for GeDialog?

    Cinema 4D SDK
    r21 python
    2
    4
    399
    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.
    • B
      bentraje
      last edited by

      Hi,

      I understand there is GetWidth for GeUserArea.
      Is there also a GetWidth equivalent for GeDialog?

      I have a bunch of images in a grid with 5 colums.
      I want the number of columns to change based on the Width of the GeDialog

      Is there a way around this?

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi @bentraje you can retrieve the size of the current window with BFM_ADJUSTSIZE

            def Message(self, msg, result) :
                if msg.GetId() == c4d.BFM_ADJUSTSIZE: 
                  print 'x => ' + str(msg[c4d.BFM_ADJUSTSIZE_WIDTH])
                  print 'y => ' + str(msg[c4d.BFM_ADJUSTSIZE_HEIGHT])
              
                return c4d.gui.GeDialog.Message(self, msg, result)
        

        Then it's up to you to store the value in a member variable of your class.

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 1
        • B
          bentraje
          last edited by

          @m_adam

          Thank you. Works as expected.

          1 Reply Last reply Reply Quote 0
          • B
            bentraje
            last edited by

            Hi @m_adam .

            Apologies for bringing up the thread again. I just have a follow up question.

            The def Message works well for the consecutive duration of the dialog.
            But for the initial life (i.e on startup), the def Message will not be executed .

            Is there a way to determine the width and height of the dialog upon its startup?

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