forum-msg-id-135280-edit

Original date:2020-12-17 12:10:28 Edited by: irv Subject: Re: Phix+EuGTK

Next problem: passing a value to/from a function in a shared lib (.so) which expects a C_DOUBLE doesn't work on Linux 64 bit.

The "set" routine looks simple enough, and is the same as used in the Euphoria version, except that the slider never moves to reflect a set value.

Moving the slider with the mouse works, but reading the current value always returns zero.

 
-- GTK calls: 
 
void 
gtk_scale_button_set_value (GtkScaleButton *button, 
                            gdouble value); 
 
gdouble 
gtk_scale_button_get_value (GtkScaleButton *button); 
 
--------------- 
 
-- My version: 
 
  procedure set_value(atom x) -- slider never changes value 
  atom fn = define_c_proc(LIB,"gtk_scale_button_set_value",{C_POINTER,C_DOUBLE}) 
   c_proc(fn,{this.handle,x}) 
  end procedure 
   
  function get_value() 
  object v 
  atom fn = define_c_func(LIB,"gtk_scale_button_get_value",{C_POINTER},{C_DOUBLE}) 
   v = c_func(fn,{this.handle}) ? v -- never changes, always 0, so next line is worthless 
   this.value = float64_to_atom(peek({v,8})) -- the Eu version uses this. 
   return this.value 
  end function 
 
Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu