On Fri, Jun 18, 2021 at 7:10 PM Greg Ercolano <erco@seriss.com> wrote:
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 examplesin 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?)
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.