我试图在音频插件中添加按钮,但在测试时无法显示它。
我使用插件主机测试并查看GUI。 /* GET home page. */
router.get('/', function(req, res, next) {
res.sendFile(path.join(__dirname, '../', 'views', 'index.html'));
});
中定义了pad1
:
PluginEditor.h
我已将以下代码放入private:
// This reference is provided as a quick way for your editor to
// access the processor object that created it.
CPAudioProcessor& processor;
TextButton pad1;
:
PluginEditor.cpp
我在阅读本教程时作为如何添加按钮的指南:https://www.juce.com/doc/tutorial_rectangle_advanced
我有什么遗失的吗?它看起来与指南中的代码相同。
答案 0 :(得分:1)
问题是我忘了在覆盖的resized
方法中设置宽度/高度。
void CPAudioProcessorEditor::resized()
{
// This is generally where you'll want to lay out the positions of any
// subcomponents in your editor..
pad1.setBounds(10, 10, 100, 100);
}