Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG-RAN
Commits
841207b6
Commit
841207b6
authored
Nov 25, 2016
by
Cedric Roux
Committed by
Raymond Knopp
Jan 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
T: add function label_set_text
parent
921f0a02
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
common/utils/T/tracer/gui/gui.h
common/utils/T/tracer/gui/gui.h
+1
-0
common/utils/T/tracer/gui/gui_defs.h
common/utils/T/tracer/gui/gui_defs.h
+1
-1
common/utils/T/tracer/gui/label.c
common/utils/T/tracer/gui/label.c
+18
-0
No files found.
common/utils/T/tracer/gui/gui.h
View file @
841207b6
...
...
@@ -39,6 +39,7 @@ widget *new_space(gui *gui, int width, int height);
widget
*
new_image
(
gui
*
gui
,
unsigned
char
*
data
,
int
length
);
void
label_set_clickable
(
gui
*
gui
,
widget
*
label
,
int
clickable
);
void
label_set_text
(
gui
*
gui
,
widget
*
label
,
char
*
text
);
void
container_set_child_growable
(
gui
*
_gui
,
widget
*
_this
,
widget
*
child
,
int
growable
);
...
...
common/utils/T/tracer/gui/gui_defs.h
View file @
841207b6
...
...
@@ -141,7 +141,7 @@ struct button_widget {
struct
label_widget
{
struct
widget
common
;
c
onst
c
har
*
t
;
char
*
t
;
int
color
;
int
width
;
/* as given by the graphic's backend */
int
height
;
/* as given by the graphic's backend */
...
...
common/utils/T/tracer/gui/label.c
View file @
841207b6
...
...
@@ -81,3 +81,21 @@ void label_set_clickable(gui *_g, widget *_this, int clickable)
gunlock
(
g
);
}
void
label_set_text
(
gui
*
_g
,
widget
*
_this
,
char
*
text
)
{
struct
gui
*
g
=
_g
;
struct
label_widget
*
this
=
_this
;
glock
(
g
);
free
(
this
->
t
);
this
->
t
=
strdup
(
text
);
if
(
this
->
t
==
NULL
)
OOM
;
x_text_get_dimensions
(
g
->
x
,
DEFAULT_FONT
,
text
,
&
this
->
width
,
&
this
->
height
,
&
this
->
baseline
);
send_event
(
g
,
REPACK
,
this
->
common
.
id
);
gunlock
(
g
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment