[lazarus] A Little Cleanup
Curtis White
osiriz at teleport.com
Sat Jul 24 14:05:57 EDT 1999
I was just working on the notebook component, trying to figure out how this
whole thing works (separating out the gtk code to the gtkint.pp unit). I
noticed a couple things that we may want to change now before too much code
gets written with them this way.
According to the instructions, to add a new component, we add a constant to
vclGlobals.pp and then again to gtkint.pp. These are the exact same constants
in both units. Why not just add it to vclglobals and then include that unit in
the uses clause of gtkint? Then we just have to add the constant once.
Another thing I noticed was a function in gtkint called Converttogdk. This
function converts a TColor to a gdk color. But this function name does not
describe what the function does and could be really confusing. I suggest
changing it to more closely resemble the way Delphi does these kind of functions
and call it ColorToGDKColor. This would describe the what the function does much
better. There is already a function called TColortogdkColor, but all it does is
create a gdkcolor record, set the color to Red and return a pointer it. This
function seems pretty useless as it is. It doesn't even do anything with the
color that is passed in. I think these two functions should be combined to do
what they are supposed to do.
Thanks...Curtis
More information about the Lazarus
mailing list