Dialog window appearens problem


#1

Hi All;

When i click to the list box i want to have a dialogWindow but when i click to listbox item a dialogwindow appears on the wndow but there is no close or minimise button on it.What is my wrong in this code.The dialog window is black and nothing on it.

[code]
#include “includes.h”
//[/Headers]

class mycomponent: public Component
{
public:
mycomponent()
{
addAndMakeVisible(buton = new TextButton(T(“emre”)));
setBounds(10,10,100,30);

}
~mycomponent()
     { 
      }

private:
TextButton* buton;
};

class alertim: public DialogWindow
{
public:
alertim()
:DialogWindow (T(“Alert Window”),
Colours::lightgrey,
true)
{
mycomponent* contentComponent = new mycomponent();
setContentComponent(contentComponent);
setSize(600,500);
setVisible(true);

}
~alertim()
{
}
void paint (Graphics& g)
{
}
void resized(){}
void buttonClicked (Button* buttonThatWasClicked){}
void closeButtonPressed()
{
	 JUCEApplication::quit();
}

};[/code]

http://img144.yehhe.com/images/5636adsiz.JPG


#2

I’ll go first with my paraphrase of the Hitch-Hiker’s Guide line:

“a jet black button on a jet black control panel in a jet back room”

but actually, you probably just need to do

buton->setBounds(10,10,100,30);

Your code was setting the bounds of the whole component, which was overriden by the setSize later anyway.

You should also add a paint method too, to make it useful.

Bruce


#3

Yes… and if you override paint() in your documentwindow, then you stop the documentwindow class actually painting itself, and end up with a blank window…


#4

Oh! very tanks jules.Paint Function.I get it.Tanks again.