Problem adding several DirectButton in a DirectScrolledFrame

Hi to all,
I have created a DirectScrolledFrame with:

myframe = DirectScrolledFrame(canvasSize=(-2, 2, -2, 2), frameSize=(-.5, .5, -1, 1), scrollBarWidth=0.05, frameColor=color_dic['GREY'])

then i want to add several buttons in the frame:

for i in range(100):            
    DirectRadioButton(text=mytext, text_scale=0.05, frameSize=(-0.11, 0.12, -0.02, 0.04), 
                                   relief = RAISED, borderWidth=(0, 0), pos=(-0.38, 0., 0.96-0.07*i), 
                                   parent=myframe)

but it looks like the buttons are “detached” from the DirectScrolledFrame. when i scroll down the next items do not follow.


i am not sure that what i do is the correct way to do it?

Attaching objects within a DirectScrolledFrame is done by parenting them not to the frame itself, but rather to its “canvas” object, I believe. You should be able to get this by calling “myFrame.getCanvas()”.

You can find more detail on this manual page, I believe.

1 Like

yap that was it, thanks!

1 Like