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

    How are initw and inith processed?

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 204 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/2013 at 08:02, xxxxxxxx wrote:

      Hello everybody,

      me again. One little question. Id like to create a GeDialog with some statictext members. I want them exatly sized (pixel). But inith and initw are processed in a strange way. If I define the both initw = 100 and inith = 100, I expect a square, but it isnt. Does someone know why?

      Example:

      import c4d  
      from c4d import gui  
        
      #Welcome to the world of Python  
        
      class Dlg(gui.GeDialog) :  
        
        def CreateLayout(self) :  
            w = 100 #initw  
            h = 100 #inith  
            flag = c4d.BFH_LEFT| c4d.BFV_TOP  
              
            self.GroupBegin(0, flags=c4d.BFV_TOP|c4d.BFH_LEFT, cols=2)  
            self.AddStaticText(1, flags=flag, initw = w, inith = h, name="test", borderstyle=c4d.BORDER_THIN_IN)  
            self.AddStaticText(2, flags=flag, initw = w, inith = h, name="test", borderstyle=c4d.BORDER_THIN_IN)  
            self.GroupEnd()  
              
            return True  
        
        def InitValues(self) : return True   
        
        def Command(self, id, msg) : return True  
        
      def main() :   
        dlg = Dlg()  
        dlg.Open(c4d.DLG_TYPE_MODAL, defaultw=300, defaulth=300)  
        c4d.EventAdd()  
        
      if __name__=='__main__':  
        main() 
      

      Result:

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

        On 24/03/2013 at 08:18, xxxxxxxx wrote:

        Hi rown,

        yes, width / height != 1. I don't know why. It's strange, but it's Cinema. And you can't do something about it. I have also noticed that the height in pixels resulting from the height you give the widget differs on various screen sizes.

        I have started a similar thread here, maybe I can find it.. But there is not answer on it either.. 😕

        Best,
        -Niklas

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