mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-09 13:02:01 +03:00
* widget.c (label_new): Don't calculate dimensions of multiline
labels, since they cannot be changed and msglen() is already used when the dialog is created.
This commit is contained in:
parent
cf5ddb2e33
commit
e840cff0dc
@ -1,5 +1,9 @@
|
||||
2001-09-03 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* widget.c (label_new): Don't calculate dimensions of multiline
|
||||
labels, since they cannot be changed and msglen() is already
|
||||
used when the dialog is created.
|
||||
|
||||
* Makefile.in: Converted to ...
|
||||
* Makefile.am: ... this.
|
||||
|
||||
|
12
src/widget.c
12
src/widget.c
@ -628,9 +628,17 @@ label_destroy (WLabel *l)
|
||||
WLabel *
|
||||
label_new (int y, int x, const char *text, char *tkname)
|
||||
{
|
||||
WLabel *l = g_new (WLabel, 1);
|
||||
WLabel *l;
|
||||
int width;
|
||||
|
||||
init_widget (&l->widget, y, x, 1, text ? strlen (text) : 0,
|
||||
/* Multiline labels are immutable - no need to compute their sizes */
|
||||
if (!text || strchr(text, '\n'))
|
||||
width = 1;
|
||||
else
|
||||
width = strlen (text);
|
||||
|
||||
l = g_new (WLabel, 1);
|
||||
init_widget (&l->widget, y, x, 1, width,
|
||||
(callback_fn) label_callback,
|
||||
(destroy_fn) label_destroy, NULL, tkname);
|
||||
l->text = text ? g_strdup (text) : 0;
|
||||
|
Loading…
Reference in New Issue
Block a user