Hi,
I think it's a good idea to have a C++ example as well as the normal C
one for GTK+.
If you wanted comments on the code itself:
- ScintillaWindow doesn't appear to need to be virtual, so you could
leave out `virtual ~ScintillaWindow() = default;` and it won't get a
vtable and all that jazz.
- ScintillaWindow constructor could use the initialization list to set
`editor` and `sci` instead of doing it in the body.
- I'm not super familiar with gtkmm ownership semantics, but it looks
like ScintillaWindow::editor is leaked, I think you need to use
Gtk::manage() or something to have the container delete it, or else
delete it in ScintillaWindow's destructor.
- It's handy for scintilla_send_message wrapper (Call) to provide =0
default arguments for wparam and lparam since often times they aren't
used. The member function Call in ChumPort could do the same or just
forward the arguments to ScintillaWindow::Call using variadic template
arguments/perfect forwarding.
- I think `virtual ~ChumPort() = default;` is redundant as it's already
virtual and the compiler will provide a default implementation (I could
be wrong, I'm no C++ expert to be sure).
- In ChumPort::on_action_file_open, you could use
Glib::file_get_contents() to read the file instead of the C stdio stuff.
- The number 932 seems magical.
Nothing major, just stuff I noticed while skimming the code.
It would be cool to update the bait example to be more feature-full too,
if I get bored I could have a crack at it if you want. It'd probably 100
lines longer or so.
Regards,
Matthew Brush