Examples on page 394 of Users Guide 5.21

Hi,

A few comments on the example2b.{h,cxx}

example2b.h:

  1. To move the definition of DoDraw() to the header file, I think the inclusion of following headers should also be moved:

#include <TCanvas.h> #include <TF1.h> #include <TRandom.h>

and the following added to the header

#include <TRootEmbeddedCanvas.h>

  1. Isn’t it better to write the body of virtual ~MyMainFrame() just as

instead of

example2b.cxx:
Isn’t it better to include the following lines?

void example() { ... } int main() { ... }

I know that experienced programmers won’t confuse, but I will…

By the way, I think it’s better to use SIMPLE double quotation marks on #include lines: in example2[ab].cxx, OPENING/CLOSING double quotation marks are used.

Yours,
Kazuyoshi

I will look at that.

Hi,

In principle you are right, but the code you refer to is just a guideline to show the difference between using RQ_OBJECT and inheriting from a TQObject class. It is not a fully working example.
This kind of coding: { ... } means: user has to do (write) some code there, and has nothing to do with:

{;} which is a no-op piece of code…

And sorry, but I don’t understand what you mean by: [quote]By the way, I think it’s better to use SIMPLE double quotation marks on #include lines: in example2[ab].cxx, OPENING/CLOSING double quotation marks are used.[/quote]
Cheers,
Bertrand.

Hi, Bertrand-san,

Well, yes. But, the only thing done in the destructor (in the script version) are cleanup and delete of fMain, and this version uses an object which was derived from TGMainFrame, therefore I thought there’s nothing to do in the destructor…

[quote=“bellenot”]
And sorry, but I don’t understand what you mean by: [quote]By the way, I think it’s better to use SIMPLE double quotation marks on #include lines: in example2[ab].cxx, OPENING/CLOSING double quotation marks are used.[/quote]
Cheers,
Bertrand.[/quote]

I think it’s better to use plain "s, instead of (well, it seems that phpBB doesn’t support the use of multibyte characters and it’s difficult to show them here) using left/right inclined double quotation marks.
Please see the marks in the “example2b.h” line of the example.

Kazuyoshi

I have done the double quote modifications. Take the new version on the web.