Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
6ca2128f
Commit
6ca2128f
authored
Oct 14, 2016
by
George Marques
Committed by
GitHub
Oct 14, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6807 from volzhs/buttongroup-signal
Add "button_selected" signal to ButtonGroup
parents
292132ef
870ed6f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
button_group.cpp
scene/gui/button_group.cpp
+4
-0
No files found.
scene/gui/button_group.cpp
View file @
6ca2128f
...
...
@@ -60,6 +60,9 @@ void ButtonGroup::_pressed(Object *p_button) {
BaseButton
*
bb
=
E
->
get
();
bb
->
set_pressed
(
b
==
bb
);
if
(
b
==
bb
){
emit_signal
(
"button_selected"
,
b
);
}
}
}
...
...
@@ -153,6 +156,7 @@ void ButtonGroup::_bind_methods() {
ObjectTypeDB
::
bind_method
(
_MD
(
"_pressed"
),
&
ButtonGroup
::
_pressed
);
ObjectTypeDB
::
bind_method
(
_MD
(
"set_pressed_button"
,
"button:BaseButton"
),
&
ButtonGroup
::
_pressed
);
ADD_SIGNAL
(
MethodInfo
(
"button_selected"
,
PropertyInfo
(
Variant
::
OBJECT
,
"button"
,
PROPERTY_HINT_RESOURCE_TYPE
,
"BaseButton"
)));
}
ButtonGroup
::
ButtonGroup
()
:
BoxContainer
(
true
)
...
...
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