<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Am 20.10.2014 13:26, schrieb Philippe
Coatmeur:<br>
</div>
<blockquote cite="mid:5444F173.7060602@gnu.org" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
Hello Harry;<br>
<br>
<div class="moz-cite-prefix">On 20/10/14 09:07, Harry van Haaren
wrote:<br>
</div>
<blockquote
cite="mid:CAKudYbMU3fwu+hkWWD2jQruU4Ekfcc3gF-VBimG-u753+YQyVQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra"><br>
<div class="gmail_quote">Most NTK widgets that have a
"value" like a slider or a dial, derive from a base class
that implements value() and value( float );</div>
<div class="gmail_quote"><br>
</div>
<div class="gmail_quote">What this means for a widget, is
that in order to change the value of a widget called
"wid", we do this:</div>
<div class="gmail_quote">wid->value( 0.0f ); // sets
widget value to 0</div>
</div>
</div>
</blockquote>
Oh, I get that, believe me. The info I need is around that ; I
wish your sentence had started earlier, like so "in port_event(),
given <i>this</i> class declared like <i>this</i> and an objet <tt>wid</tt>
instantiated like <i>this</i>, we do this (...)"<br>
<br>
From my <tt>port_event()</tt> I point to my UI object via the <tt>LV2UIHandle</tt>.
this object is a NTK widget (or so I hope, read on). So if I get
a:<br>
<br>
<tt>error: ‘class KisWidget’ has no member named ‘value’</tt>
(it's pretty explicit)<br>
<br>
It means the class KisWidget has no member named "value" I guess
we can agree on that ;)<br>
<br>
It must be that I did not declare my Widget class as a proper NTK
widget. The declaration is at line 25 in <a
moz-do-not-send="true"
href="https://bitbucket.org/xaccrocheur/kis/src/8c3a85a9899f117d2fa273b6c7948402d780fb46/widget.h?at=master">this
file</a>. The instantiation of the widgets (a FL_Dial and 5
FL_Slider) is at line 96 in <a moz-do-not-send="true"
href="https://bitbucket.org/xaccrocheur/kis/src/8c3a85a9899f117d2fa273b6c7948402d780fb46/widget.cpp?at=master">this
file</a>.<br>
<br>
Now for the direct questions: <br>
<ul>
<li>Is it a proper NTK widget class declaration, that would
expose a <tt>value()</tt> method?</li>
<li>Are those proper NTK widget class instances?<br>
</li>
</ul>
Thanks for your patience<br>
<br>
--Phil<br>
</blockquote>
I never use FLTK, but I guess that is something essential. <br>
You need to declare your control widgets in the <tt>class
KisWidget, </tt>not in the constructor of the class.<tt><br>
<br>
in </tt><tt>class KisWidget write <br>
<br>
</tt><span class="n">Fl_Slider</span><span class="o">*</span> <span
class="n">ReleaseButton;<br>
<br>
in the constructor </span><span class="n">Widget</span><span
class="o">::</span><span class="n">Widget</span><span class="p">(</span><span
class="kt">void</span><span class="o">*</span> <span class="n">parentXwindow</span><span
class="p">) write <br>
</span><span class="n"><br>
ReleaseButton</span> <span class="o">=</span> <span class="k">new</span>
<span class="n">Fl_Slider</span><span class="p">(</span> <span
class="mi">220</span><span class="p">,</span><span class="mi">5</span><span
class="p">,</span><span class="mi">35</span><span class="p">,</span><span
class="mi">100</span><span class="p">,</span><span class="s">"Rel"</span><span
class="p">);<br>
<br>
Then you could access the widget pointers in </span><span
class="file-name">kis_gui.cpp </span>like that <br>
<pre><span class="k">static</span> <span class="kt">void</span> <span class="nf">port_event</span><span class="p">(
</span><span class="c1">self->widget-></span><span class="c1"><span class="n">ReleaseButton</span></span><span class="c1"><span class="c1">->value</span>(value);</span>
ReleasButton is a NTK widget, not your <tt>class KisWidget.
(Just pseudo code here, it isn't exact syntax)
</tt></pre>
<span class="file-name">Still, I never use FLTK, I just wonder if
you didn't need a deconstructor to delete the widgets instances
which have created with "new" ( Like you need to do in GTKmm)?<br>
Did FLTK manage the memory? <br>
</span>
</body>
</html>