Re: [gtk-list] Re: Method to query toggle button state?



Coming in late here...

   > That was precisely the point of my post.  IME, it's not a good
   > design for programs to have to access internal widget members
   > directly.  In OO, you could say this is defeating the object's
   > encapsulation.

   Not if .active is a public member of the object.  Or am I missing a
   subtler point?

There shouldn't be any public data members.  The fact that there is,
is itself a mistake.

   > But however you choose to describe it, programs that do stuff like
   > this are dependent on the internal design of the object and that is
   > a "bad thing" (tm).

   Again, if the .active element is a public member of the structure.  I
   fail to see what a macro or an inline function would buy you here,
   exactly.

If you get people to use the macro or inline, you can get rid of the
public data member eventually.

Speaking as somebody who is currently porting an application to 1.1.1
to 1.1.16, the argument that ``everybody uses .active so it can't go
away'' rings a little hollow!  (ok_button, anybody?)
-- 
Joseph J. Pfeiffer, Jr., Ph.D.       Phone -- (505) 646-1605
Department of Computer Science       FAX   -- (505) 646-1002
New Mexico State University          http://www.cs.nmsu.edu/~pfeiffer



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]