FLTK logo

Re: [fltk.general] how can i declare & define Browser callback?

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: how can i declare & define Browser callback? Greg Ercolano Jun 18, 2021  
 

    
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.

    For the cheat sheet and examples, the code normally broken up over separate .cxx / .H files
    are all kept in one file just to make it easy to copy/paste.

    But yeah, typically the class MyWhatever is declared in the MyWhatever.H file,
    and the methods are defined in the MyWhatever.cxx file

struct Brwsr : Fl_Hold_Browser {
Brwsr(int x, int y, int w1, int w2, int h);
void brwsr_cb(Fl_Widget*, void *v);
};

    Most of your example looks fine, but why are you using "struct" instead of "class" in the above?

    Use class so you can use all the normal keywords to control method visibility such as
    public: and protected: and private: and so it's clearly a class.

--
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/a2d8fbbc-d880-f138-37b9-58e03617eda3%40seriss.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.