aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/src/gen/wxToggleButton.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2016-10-05 16:25:59 +0200
committerDan Gudmundsson <[email protected]>2016-10-05 16:25:59 +0200
commit097cc3f6679a7c3769111cdb15a630186218d015 (patch)
treec92a39384d8989695e4318fc16edef10faf7da19 /lib/wx/src/gen/wxToggleButton.erl
parent1de609cb262ff34216dce8fbefdb9a153bdd2c93 (diff)
downloadotp-097cc3f6679a7c3769111cdb15a630186218d015.tar.gz
otp-097cc3f6679a7c3769111cdb15a630186218d015.tar.bz2
otp-097cc3f6679a7c3769111cdb15a630186218d015.zip
Fix guard test for chardata
Previously only accepted lists tough a call is made to unicode:characters_to_binary/1, and the functions where specified to handle chardata.
Diffstat (limited to 'lib/wx/src/gen/wxToggleButton.erl')
-rw-r--r--lib/wx/src/gen/wxToggleButton.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/wx/src/gen/wxToggleButton.erl b/lib/wx/src/gen/wxToggleButton.erl
index 9d96527af1..6a41cef9ae 100644
--- a/lib/wx/src/gen/wxToggleButton.erl
+++ b/lib/wx/src/gen/wxToggleButton.erl
@@ -90,7 +90,7 @@ new() ->
Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata().
new(Parent,Id,Label)
- when is_record(Parent, wx_ref),is_integer(Id),is_list(Label) ->
+ when is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Label) ->
new(Parent,Id,Label, []).
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxtogglebutton.html#wxtogglebuttonwxtogglebutton">external documentation</a>.
@@ -101,7 +101,7 @@ new(Parent,Id,Label)
| {'style', integer()}
| {'validator', wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
- when is_integer(Id),is_list(Label),is_list(Options) ->
+ when is_integer(Id),?is_chardata(Label),is_list(Options) ->
?CLASS(ParentT,wxWindow),
Label_UC = unicode:characters_to_binary([Label,0]),
MOpts = fun({pos, {PosX,PosY}}, Acc) -> [<<1:32/?UI,PosX:32/?UI,PosY:32/?UI,0:32>>|Acc];
@@ -118,7 +118,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
This::wxToggleButton(), Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata().
create(This,Parent,Id,Label)
- when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Label) ->
+ when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Label) ->
create(This,Parent,Id,Label, []).
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxtogglebutton.html#wxtogglebuttoncreate">external documentation</a>.
@@ -129,7 +129,7 @@ create(This,Parent,Id,Label)
| {'style', integer()}
| {'validator', wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
- when is_integer(Id),is_list(Label),is_list(Options) ->
+ when is_integer(Id),?is_chardata(Label),is_list(Options) ->
?CLASS(ThisT,wxToggleButton),
?CLASS(ParentT,wxWindow),
Label_UC = unicode:characters_to_binary([Label,0]),