Hi there,
I'm currently having troubles to understand the workflow when using FindCustomGui
. I'm currently relying on a Dialog created via ResEdit. Within this Dialog I have a Flushgroup where I create Buttons via AddCustomGui
. This works totally fine and I'm able to set different settings via the c4d.BaseContainer
.
However when using FindCustomGui
I'm not sure on where I need to use: SetData()
to set for example the FORCESIZE
of the button to 16
.
Pseudo-Code looks like this:
bc = c4d.BaseContainer() # Create a new container to store the button image
bc.SetBool(c4d.BITMAPBUTTON_BUTTON, True)
bc.SetInt32(c4d.BITMAPBUTTON_ICONID1, iconid)
bc.SetString(c4d.BITMAPBUTTON_TOOLTIP, "tooltip")
bc.SetInt32(c4d.BITMAPBUTTON_FORCE_SIZE, 16)
button = self.AddCustomGui(buttonid, c4d.CUSTOMGUI_BITMAPBUTTON, "Title", c4d.BFH_MASK | c4d.BFV_CENTER, 0, 0, bc)
Works like a charm :point_up:
button = self.FindCustomGui(buttonid, c4d.CUSTOMGUI_BITMAPBUTTON)
# button.GetData() is None.
button.SetImage(bmp, True)
Even if I create my own c4d.BaseConainer
again and setting it via SetData
:
button = self.FindCustomGui(buttonid, c4d.CUSTOMGUI_BITMAPBUTTON)
bc = c4d.BaseContainer()
bc.SetInt32(c4d.BITMAPBUTTON_ICONID1, iconid)
bc.SetString(c4d.BITMAPBUTTON_TOOLTIP, "tooltip")
bc.SetInt32(c4d.BITMAPBUTTON_FORCE_SIZE, 16)
button.SetData(bc)
# After button.SetData(bc) button.GetData() is still None..!
button.SetImage(bmp, True)
This would really save me a lot of pain flushing manually different groups for those bitmapbuttons... Any ideas? What am I doing wrong?
Cheers,
Lasse