|
|
On 6/18/21 10:18 AM, Dave Jordan wrote:
Subject: how can i declare &
define Browser callback?
I haven't found any examples that use a subclassed
Browser with .h & .cpp files.
It sounds like you're looking for an example that
subclasses Fl_Hold_Browser
and uses callbacks, so an example of that might be:
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Hold_Browser.H>
// Demonstrate subclassing Fl_Hold_Browser and using callback -erco 6/18/21
class MyBrowser : public Fl_Hold_Browser {
right, i did see examples in various places including your cheat page and the examples dir, but again, no "MyBrowser.h" or the like was in evidence, so I wasn't sure about the decl. I had some simple compile error to start with, i dont even remember what, and then i got too complicated trying to fix it.
this is how I have it now:
#ifndef BRWSR_H #define BRWSR_H #include "glbl.h" // include various FL widget headers
struct Brwsr : Fl_Hold_Browser {
Brwsr(int x, int y, int w1, int w2, int h); void brwsr_cb(Fl_Widget*, void *v);
}; #endif // BRWSR_H
********************************** #include yada yada.h Brwsr::Brwsr(int x, int y, int w1, int w2, int h) : Fl_Hold_Browser(x, y, w1 + w2, h) {
// set appearance properties
void Brwsr::brwsr_cb(Fl_Widget *w, void *v) { // use browser widget to control which game is displayed (what did i see it called? vertical tabbed dialog?)
// assign gm to app->cur.game
}
}
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/CAPdW6bKm%2BkSrD3MByagCvwxmXOR7tgCSQY%3Dq4QbKWb0_-Qe2Mg%40mail.gmail.com.
[ Direct Link to Message ] | |
|
| |