Closed sk-Prime closed 5 years ago
You can change the font of the panel before wTextCtrl
creation. Because the font is inheritable, the wTextCtrl
will get the correct size when creation.
If you change the font of a control after creation. You can set the size to its getDefaultSize()
. And this is what wWindow.suit()
does. For example: textentry.suit()
or textentry.size = textentry.defaultSize
, it in actually is textentry.setSize(textentry.getDefaultSize())
.
For current implementation, getDefaultSize() for wTextCtrl use a fix width. You can also change it after suit() but keep the height. For example: textentry.size = (200, wDefault)
.
thanks it solves the problem.
in this example,
textCtrl
can not show font properly because the font size is bigger than textCtrl size.Q: how to change
textCtrl
size manualy, astextentry.fit()
maketextCtrl
size smallest because init value is = "", and i don't want to changetextCtrl
length, i want it to be fixed length. if there are 4 char intextCtrl
, the fit() make it small and show only 4 char.