MacArthur, Ian (Leonardo, UK)
unread,Jan 11, 2017, 4:58:11 AM1/11/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fltkg...@googlegroups.com
OK, I concur with Nikita's suggestion here...
The "ch1_shift" in this code here:
> void cb_ch1_shift(Fl_Widget*,void*) {
> Ch1Shift = ch1_shift->value();
> }
Is not the same "ch1_shift" that is in this code below, since this one is declared after the one above is used in the callback, and so presumably is not in scope for the callback.
The one above is probably referring to some other variable called "ch1_shift", which I guess is NULL at the point that the callback executes it.
> Fl_Line_Dial *ch1_shift = new Fl_Line_Dial(x,y,40,40);
> It looks functionally identical to me, so something else may have changed of
> which I'm unaware. Both callbacks are outside blocks and so should be
> static. The latter works fine when no member functions are invoked, but
> invoking value() causes the problem.
No, as noted, I suspect that the variable scope is different and hence the function of the code is altered, producing the segfault you report.
Leonardo MW Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************