Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vecs
FIJI Public
Commits
7099eb72
Commit
7099eb72
authored
Aug 18, 2016
by
Stefan Tauner
Browse files
Fix use of undefined variable in FIJIModalDialog by fetching buttons from DialogBoxUL
parent
14c5ab11
Changes
2
Hide whitespace changes
Inline
Side-by-side
bin/Tk/DialogBoxUL.pm
View file @
7099eb72
...
...
@@ -93,6 +93,7 @@ sub Populate {
if
(
defined
(
$accel
))
{
$cw
->
bind
("
<Alt-
$accel
>
"
=>
[
$b
,
'
Invoke
']);
}
push
(
@
{
$cw
->
{'
buttons
'}},
$bl
);
}
if
(
defined
$default_button
&&
!
$cw
->
{'
default_button
'})
{
warn
"
Default button `
$default_button
' does not exist.
\n
";
...
...
@@ -109,6 +110,10 @@ sub Populate {
$cw
->
Delegates
('
Construct
',
$top
);
}
sub
buttons
{
return
\
@
{
shift
->
{'
buttons
'}};
}
sub
add
{
my
(
$cw
,
$wnam
,
@args
)
=
@_
;
my
$w
=
$cw
->
Subwidget
('
top
')
->
$wnam
(
@args
);
...
...
bin/Tk/FIJIModalDialog.pm
View file @
7099eb72
...
...
@@ -25,27 +25,28 @@ sub Populate {
my
$text
=
delete
$args
->
{'
-text
'};
my
$markuptext
=
delete
$args
->
{'
-markuptext
'};
my
$wraplength
=
delete
$args
->
{'
-wraplength
'};
my
@buttons
=
@
{
$args
->
{'
-buttons
'}};
$self
->
SUPER::
Populate
(
$args
);
my
$buttons
=
$self
->
buttons
();
Tk::FIJIUtils::
set_icon
(
$self
);
my
$esc_button
;
if
(
@buttons
==
1
)
{
$esc_button
=
@buttons
[
0
];
$esc_button
=~
tr/~//d
;
# filter ~
if
(
@$buttons
==
1
)
{
$esc_button
=
@$buttons
[
0
];
}
else
{
foreach
my
$b
(
@buttons
)
{
$b
=~
tr/~//d
;
# filter ~
foreach
my
$b
(
@$buttons
)
{
if
(
$b
eq
"
Cancel
")
{
$esc_button
=
$b
;
last
;
}
}
}
$logger
->
debug
("
Binding escape to
$esc_button
");
$self
->
bind
('
<Escape>
'
=>
[
$self
->
Subwidget
("
B_
$esc_button
"),
'
Invoke
']);
if
(
defined
(
$esc_button
))
{
$logger
->
debug
("
Binding escape to
$esc_button
");
$self
->
bind
('
<Escape>
'
=>
[
$self
->
Subwidget
("
B_
$esc_button
"),
'
Invoke
']);
}
$self
->
add
('
Label
',
-
image
=>
$image
)
->
pack
(
-
side
=>
'
left
')
if
(
defined
$image
);
...
...
Write
Preview
Supports
Markdown
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