I was working on a project unaware that gridlayout doesnt shows scrollbar, so when the number of items increases they are not not shown up properly is their any control from layout i can use to put scrolllbar if number of items coming from list increases, i tried using scrollLayout with grid layout but that doesnt serves the purpose
maya.cmds.gridLayout(self._poseGrid, e=True,bgc=(0.2,0.2,0.2),cr=True, h=200,vis=False)
for pose in self.poseImport.list():
cmd=partial(self.applyPose,pose)
maya.cmds.iconTextButton(parent =self._poseGrid, style='iconAndTextVertical',width=self._iconSize[0], height=self._iconSize[1], image1=pose.thumb, label ='%s' %(pose.name), command = cmd)
maya.cmds.gridLayout(self._poseGrid,e=True,vis=True)
Can’t you just put your gridLayout inside a scrollLayout? That’s the way I’ve set up a pose grid UI before and it works pretty nicely. The scrollLayout also has the benefit that it has a resize callback which you can use to update the number of columns in the gridLayout if you need that.
I believe that the shelfLayout also used to do what you are looking for. It used to support multi-line height and you could put icon buttons into it and it would scroll if needed. Although, if I remember rightly in 2011 multi-line shelfLayouts didn’t work any more. I don’t know whether that is still true in newer versions or not though. You could have a look at the old MEL version of poseMan for an example of a shelfLayout used like this. If you try it out in your version of Maya and you get a single line then you’ll know it’s still broken :P.