How to make static texts bold? Icons?
-
Hi guys,
1- I have a question. How can I make a static text bold? I tried some common methods in Python but they didn't work!
self.AddStaticText(id=2001, flags=DEFAULT_TEXT_FLAGS, name=static_text)
2- How can I add an icon to a button without using custom icons? Does Cinema4D provide any default icon like Blender?
self.AddButton(id=3002, flags=c4d.BFH_SCALEFIT, initw=100, name="Button!")
-
Hello @momoko,
Thank you for reaching out to us. I understand that especially when getting familiar with a new API that the thirst for knowledge is immeasurable and the questions are uncountable but I must also point out our Support Guidelines here, especially our Support Topic Rules. A support topic should be mono-thematic, i.e., usually have one question only. If you have multiple questions, please open multiple topics.
Please also make sure that your questions are repeatable as outlined in the guidelines. Usually this means complete code. I can guess from the context in this case that you are talking about
GeDialog
but I might not be able to in a more complex case.How can I make a static text bold? I tried some common methods in Python but they didn't work!
I am not sure what you mean with common methods in Python, but you can make a static text font bold by a bit counterintuitively setting its border style. There is no italic option and bold emphasis should be used only very selectively.
self.AddStaticText(id=2001, flags=c4d.BFH_SCALEFIT, name="Hello World", borderstyle=c4d.BORDER_WITH_TITLE_BOLD)
How can I add an icon to a button without using custom icons? Does Cinema4D provide any default icon like Blender?
I am not 100% sure how this is meant. Buttons with icons and text are a bit atypical in Cinema 4D and usually only appear in palettes. The standard dialog button cannot have an icon. But you can use a
CUSTOMGUI_BITMAPBUTTON
, but they are not really meant to have a caption. You can find a Python example here.Cheers,
Ferdinand