How are initw and inith processed?
-
On 24/03/2013 at 08:02, xxxxxxxx wrote:
Hello everybody,
me again. One little question. Id like to create a GeDialog with some statictext members. I want them exatly sized (pixel). But inith and initw are processed in a strange way. If I define the both initw = 100 and inith = 100, I expect a square, but it isnt. Does someone know why?
Example:
import c4d from c4d import gui #Welcome to the world of Python class Dlg(gui.GeDialog) : def CreateLayout(self) : w = 100 #initw h = 100 #inith flag = c4d.BFH_LEFT| c4d.BFV_TOP self.GroupBegin(0, flags=c4d.BFV_TOP|c4d.BFH_LEFT, cols=2) self.AddStaticText(1, flags=flag, initw = w, inith = h, name="test", borderstyle=c4d.BORDER_THIN_IN) self.AddStaticText(2, flags=flag, initw = w, inith = h, name="test", borderstyle=c4d.BORDER_THIN_IN) self.GroupEnd() return True def InitValues(self) : return True def Command(self, id, msg) : return True def main() : dlg = Dlg() dlg.Open(c4d.DLG_TYPE_MODAL, defaultw=300, defaulth=300) c4d.EventAdd() if __name__=='__main__': main()
Result:
-
On 24/03/2013 at 08:18, xxxxxxxx wrote:
Hi rown,
yes, width / height != 1. I don't know why. It's strange, but it's Cinema. And you can't do something about it. I have also noticed that the height in pixels resulting from the height you give the widget differs on various screen sizes.
I have started a similar thread here, maybe I can find it.. But there is not answer on it either..
Best,
-Niklas