apptitle = T(" | JUCE Text Viewer");
filetitle = filename.getFileName();
newapptitle.operator = (filetitle);
newapptitle.operator += (apptitle);
//I'm about 78% sure that the next line is where I'm screwing up
DocumentWindow::setName( newapptitle );
}[/code]
Also, the reason apptitle literally has the name is because I couldn’t get getApplicationName() to work for some reason.
Well then. Just to see if I could get the titlebar to change, I took the Hello World app and modified it. I was unable to get it to change. Please take a look through and see if there is something really stupid I’m doing, heh.
[code]class HelloWorldContentComponent : public Component, ButtonListener
{
private:
TextButton* tbutton;
String text;
public:
HelloWorldContentComponent()
{
tbutton = new TextButton (T(“Click to test TitleBar”));
addAndMakeVisible( tbutton );
tbutton->setBounds( 5, 5, 0, 40);
tbutton->addButtonListener(this);
tbutton->changeWidthToFitText();
text = T("Hello World");
}
~HelloWorldContentComponent()
{
deleteAllChildren();
}
void buttonClicked (Button* button)
{
if (button == tbutton)
{
if ( text.contains( T("Hello")))
{
setName( T("New Titlebar Text"));
text = T("The button works if you see this.");
repaint();
}
else
{
setName( T("Hello World"));
text = T("Hello World");
repaint();
}
}
}
void paint (Graphics& g)
{
g.fillAll (Colours::white);
g.drawText (text,
0, 0, getWidth(), getHeight(),
Justification::centred, false);
}
};[/code]
I only included that part because I left the rest of “Hello World” untouched. The button works fine, the text changes between “hello world” and “button works…” but the title bar text remains steadfastly stuck at “Hello World”.
I’m running on Windows 7, Visual Studio 2012 Express, target is VST, Projucer Version 4.3.0.
I’m not sure if its a “Native” title bar, I’m justing using what ever title bar JUCE created by default.
Based on over 20 years experience with Win Forms and MFC, I’d say it looks like a native title bar.
Actually I’d like to get rid of the title bar altogether but that is a whole separate question.
I could easily debug it myself if it involved one of the defines in JUCE’s AppConfig.h, since many of the fields from the Projucer Config page translate into these defines. But the JUCE Debug/Release “Binary name” is what is being used, and that translates into a Visual Studio properties setting “Target Name” so I have nothing to search for in the JUCE source to find where the string is being constructed.
If the title bar just used the target name I would just leave it alone, but it is saying “synthname/Notes” on the title bar, and sometimes “synthname/1-synthname” which I don’t want at the top of my released plugin.
I’ve tried changing the JUCE “Notes” field to something, but it still just says “/Notes”.
I’ve even tried searching for any kind of string formation such as + "/Notes, or even + "//, but nothing comes up for the title bar.
I think maybe JUCE is just letting WIn Forms create its own title bar.
All I need is some idea where in JUCE to look and I could fix it myself.