You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
openLwtopenLTerm_widgetletmain()=let waiter, wakener = wait ()inlet selected =ref1inlet vbox =new vbox inlet group_int =new radiogroup inletcallback_int=function|Somen ->
selected := n
|None -> ()in
group_int#on_state_change callback_int;
let button =new button "exit"in
button#on_click (wakeup wakener);
vbox#add ~expand:false button;
vbox#add ~expand:false (new hline);
let button =objectinherit button "reset radiobuttons"(* The button should be selectable only when the group_box value is set to 1 *)
method! can_focus =!selected =1endinlet reset =fun() ->
group_int#switch_to 1;
in
button#on_click reset;
vbox#add ~expand:false button;
vbox#add ~expand:false (new hline);
let group_box =new vbox inlet radio_1 =new radiobutton group_int "Allow reset"1in
group_box#add radio_1;
group_box#add (new radiobutton group_int "Disable reset"2);
(* Disable thoses lines to get the malfunctionning *)(* radio_1#set_focus LTerm_geom.({ left = None; right = None; up = Some (button :> LTerm_widget.t); down = None });*)
vbox#add group_box;
let frame =new frame in
frame#set vbox;
Lazy.force LTerm.stdout >>=funterm ->
LTerm.enable_mouse term >>=fun() ->
Lwt.finalize
(fun() -> run term frame waiter)
(fun() -> LTerm.disable_mouse term)
let()=Lwt_main.run (main ())
The button "reset" as overriden the method get_focus for being disabled when the second radio button is selected.
But if you uncomment the lines 46-53 which define the focus rules for one radio button, the button becomes always enabled. The method can_focus is not evaluated at all.
The text was updated successfully, but these errors were encountered:
In the following example :
The button "reset" as overriden the method
get_focus
for being disabled when the second radio button is selected.But if you uncomment the lines 46-53 which define the focus rules for one radio button, the button becomes always enabled. The method
can_focus
is not evaluated at all.The text was updated successfully, but these errors were encountered: