Double Trouble with Phix (bug)(solved)
- Posted by irv Dec 20, 2020
- 1004 views
The code below will run on Euphoria or Phix without change. However, the results are different.
--/* include std/dll.e --*/ constant GTK = open_dll("libgtk-3.so.0") constant init = define_c_func(GTK,"gtk_init_check",{C_POINTER,C_POINTER},C_POINTER), show_all = define_c_proc(GTK,"gtk_widget_show_all",{C_POINTER}), main = define_c_proc(GTK,"gtk_main",{}), add = define_c_proc(GTK,"gtk_container_add",{C_POINTER,C_POINTER}), new_win = define_c_func(GTK,"gtk_window_new",{C_INT},C_POINTER), new_spin = define_c_func(GTK,"gtk_spin_button_new_with_range",{C_DOUBLE,C_DOUBLE,C_DOUBLE},C_POINTER), set_range = define_c_proc(GTK,"gtk_spin_button_set_range",{C_POINTER,C_DOUBLE,C_DOUBLE}) if init < 1 or c_func(init,{0,0})=0 then abort(1) end if atom win = c_func(new_win,{0}) atom spin = c_func(new_spin,{1,100,1}) -- range is 1..100, try it! c_proc(add,{win,spin}) --------------- c_proc(set_range,{spin,25,75}) -- range is now 25..75 on EU, 0..25 with phix --------------- c_proc(show_all,{win}) c_proc(main,{})
Something shifty going on here.