When running this code the button text does not scale to fit inside the buttons. I've tried the OTK text scale and fit text in panel functions (using retry_pb and mw) and they do nothing. Again I'm not sure if I'm doing something wrong or if there is a problem.
static void display_dev_init_err_message(int_32 message_number)
{
float y = 5.0, dy = 12.0, dy1_5 = 15.0 ;
OtkMakeTextLabel(mw, "Selected system level device interface", Otk_Black, 3.0, 1.0, 4.0, y) ;
y = y + dy ;
OtkMakeTextLabel(mw, " is locked by another program", Otk_Black, 3.0, 1.0, 4.0, y) ;
More display messages switch case statements mostly using sub-windows instead of panels at this
time...
}
}
P.S. This is the same code giving me problems with multiple sub-windows. I went as far as use different OtkWidget
structures for each window to no avail. I don't know if this panel does the same thing as the sub-windows.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This problem is caused by a slightly inaccurate estimate of the button's text-string font size. A simple remedy is to add a space or two to the end of your button text string.
I will look into adjusting the font-width measurement in the next release of OTK.
In the meantime, this remedy should force the text to fit within your buttons.
Thanks for mentioning this,
Carl
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks, I'll give that a try. Right now I'm using another work around of just adding text to the button with OtkMakeTextLabel, but I find that to be a bit of a pain.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When running this code the button text does not scale to fit inside the buttons. I've tried the OTK text scale and fit text in panel functions (using retry_pb and mw) and they do nothing. Again I'm not sure if I'm doing something wrong or if there is a problem.
static void display_dev_init_err_message(int_32 message_number)
{
float y = 5.0, dy = 12.0, dy1_5 = 15.0 ;
OtkWidget mw, retry_pb, cont_pb, exit_pb ;
mw = OtkMakePanel(OtkOuterWindow, Otk_Recessed, Otk_LightGray, 10.0, 10.0, 70.0, 80.0) ;
Otk_SetBorderThickness(mw, 0.5) ;
switch (message_number)
{
case DEVICE_LOCKED:
OtkMakeTextLabel(mw, "Selected system level device interface", Otk_Black, 3.0, 1.0, 4.0, y) ;
y = y + dy ;
OtkMakeTextLabel(mw, " is locked by another program", Otk_Black, 3.0, 1.0, 4.0, y) ;
retry_pb = OtkMakeButton(mw, 10.0, 70.0, 30.0, 20.0, "Retry", retry_pb_cb, NULL) ;
exit_pb = OtkMakeButton(mw, 50.0, 70.0, 30.0, 20.0, "Exit", exit_pb_cb, NULL) ;
break ;
More display messages switch case statements mostly using sub-windows instead of panels at this
time...
}
}
P.S. This is the same code giving me problems with multiple sub-windows. I went as far as use different OtkWidget
structures for each window to no avail. I don't know if this panel does the same thing as the sub-windows.
Gary,
This problem is caused by a slightly inaccurate estimate of the button's text-string font size. A simple remedy is to add a space or two to the end of your button text string.
For example:
OtkMakeButton(mw, 50.0, 70.0, 30.0, 20.0, "Exit ", exit_pb_cb, NULL);
I will look into adjusting the font-width measurement in the next release of OTK.
In the meantime, this remedy should force the text to fit within your buttons.
Thanks for mentioning this,
Carl
Thanks, I'll give that a try. Right now I'm using another work around of just adding text to the button with OtkMakeTextLabel, but I find that to be a bit of a pain.