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? Dave Jordan Jun 19, 2021  
 


On Sat, Jun 19, 2021 at 3:23 AM 'pvr...@btinternet.com' via fltk.general <fltkgeneral@googlegroups.com> wrote:


On Saturday, June 19, 2021 at 3:07:41 AM UTC+1 er...@seriss.com wrote:

    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.

struct is effectively the same as class except that the default access is public rather than private. As the OP stated that's why he's using struct rather than class.

It's bad practice to have default access as public as that increases the risk of coding errors.

Phil.
As soon as I wrap my head around all these other new C++ concepts I will go back and add appropriate access specifiers.
For now there is little chance i will misapply my own functions/methods and i need to follow KISS.

--
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/CAPdW6b%2B5bw2P7aURxrmv1KnWWZ95VW%2Bzexerok3tKARqkxuFDA%40mail.gmail.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'.