LayoutFlushGroup with TabGroups and ScrollGroups



  • On 05/12/2017 at 06:02, xxxxxxxx wrote:

    Hey guys,

    I've come across this weird behaviour, when dealing with LayoutFlushGroup in conjunction with TabGroups and ScrollGroups..

    Please have a look at my gif + the stripped down code.
    Obviously I am doing something wrong... any ideas?

    https://www.dropbox.com/s/y2atcony081ftow/LayoutFlushProblem.py?dl=0

    Thanks & Cheers,
    Lasse



  • On 05/12/2017 at 06:26, xxxxxxxx wrote:

    You have to make another group inside the ScrollGroupBegin and flush this one
    Which would give us

    import c4d
    from c4d import gui
    #Welcome to the world of Python
     
    class Localizer_Dialog(gui.GeDialog) :
        def CreateLayout(self) :
            self.SetTitle("Title")
            # Menu
            self.MenuFlushAll()
            self.MenuSubBegin("Info..")
            self.MenuSubEnd()
            self.MenuFinished()
             
            if self.GroupBegin(0, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 0, 0, "") :
                if self.TabGroupBegin(1, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, c4d.TAB_TABS) :
                    if self.GroupBegin(2, c4d.BFH_SCALEFIT, 3, 0, "Textures") :
                        if self.ScrollGroupBegin(3, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, c4d.SCROLLGROUP_VERT | c4d.SCROLLGROUP_HORIZ) :
                            if self.GroupBegin(4, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 0, 0, "") :
                                self.AddStaticText(100, c4d.BFH_CENTER, 0, 0, "INTITALI")
                                
                                self.GroupEnd()#0
                            self.GroupEnd()#0
                        self.GroupEnd()#1
                    self.GroupEnd()#2
                self.GroupEnd()#3
             
            return True
         
        def InitValues(self) :
     
            self.LayoutFlushGroup(4)
            self.AddStaticText(101, c4d.BFH_CENTER, 0, 0, "FLUSHED")
            self.LayoutChanged(4)
     
            return True
     
    def main() :
        dialog = Localizer_Dialog()
        dialog.Open(dlgtype=c4d.DLG_TYPE_ASYNC,pluginid=12345678,xpos=1000,ypos=500,defaultw=500,defaulth=250)
     
    if __name__=='__main__':
        main()
    


  • On 05/12/2017 at 09:28, xxxxxxxx wrote:

    Thanks for the quick answer gr4ph0s!
    I think i tried that before asking, but nonetheless.. that did the trick!!

    Thanks !


Log in to reply