Hi I tried to use the DirectCheckbox and the DirectRadioButton and I have on both the same problem.
I want to use my own images instead the relief and for the mark if check or not. But within the documentation I only see two possible values for the BoxRelief SUNKEN or RAISED. Isn’t it possible to set the BoxRelief the same way as the Releif it self? What I would like to achieve is to set my own border 4 states as on the DirectButton and 2 states for the check or unchecked state or maybe 4 states for check and 4 states for uncheked. But I cant figure out how I can achieve this?
Here is a small code fragment that I used but did not work:
GuiCheckbox = DirectRadioButton(boxPlacement = 'right', relief=None,
text="Checkbox 2", text_scale=(0.1,0.1), text_pos=(.2,-.03),
pos=(-.4, 1.0, .4), indicatorValue=False)
Is this possible what I want or not?
If you only like to change your images and no geom at all, try:
x = DirectCheckButton(
relief = None,
pressEffect = 0,
image = ("1.jpg", "2.jpg", "3.jpg", "4.jpg"),
boxRelief = None,
boxImage = ("check.jpg", "uncheck.jpg", None),
scale = 0.1,
text = "MyText")
This does actually not give the result as I expect.
First let me mention that the geom or the image are for an image around the complete gui element and not the button. This is not an actual problem just a point I did not understand from the documentation. May be this could be written better there.
The problem I got with the DirectRadioButton was that the BoxGeom is only for the FG image. Why not handle it similar to the button? This looks and feels quite different to the Button. And the interface is also quite different in contrast to the DirectCheckButton, which does not support the BoxGeom at all.
I would like to use the BoxGeom similar to the geom of the button.
I can actually solve my problem with setting the images. But I would prefer to load all the images from the egg file. Because this way it is easier to handle the scale since I can set the scale depending on the image size.
The DirectCheckButton class has an (public) indicator member. This indicator is a DirectLabel. Maybe it’s possible to modify the geom directly.