Browse Source

tags/2021-05-28
jules 18 years ago
parent
commit
112664c125
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      extras/example projects/common/Main.cpp

+ 8
- 0
extras/example projects/common/Main.cpp View File

@@ -26,10 +26,16 @@ public:
void paint (Graphics& g) void paint (Graphics& g)
{ {
// clear the background with solid white
g.fillAll (Colours::white); g.fillAll (Colours::white);
// set our drawing colour to black..
g.setColour (Colours::black); g.setColour (Colours::black);
// choose a suitably sized font
g.setFont (20.0f, Font::bold); g.setFont (20.0f, Font::bold);
// and draw the text, centred in this component
g.drawText (T("Hello World!"), g.drawText (T("Hello World!"),
0, 0, getWidth(), getHeight(), 0, 0, getWidth(), getHeight(),
Justification::centred, false); Justification::centred, false);
@@ -53,6 +59,8 @@ public:
setContentComponent (new HelloWorldContentComponent()); setContentComponent (new HelloWorldContentComponent());
setVisible (true); setVisible (true);
// centre the window on the desktop with this size
centreWithSize (400, 200); centreWithSize (400, 200);
} }


Loading…
Cancel
Save