Re: GTkClist Patch Submission (modified)



on 7/31/00 4:11 PM, Matthew at matthew@mattshouse.com wrote:

>>> @@ -5105,6 +5105,15 @@
>>> {
>>> gpointer drag_data;
>>> 
>>> +        if (event->type==GDK_2BUTTON_PRESS) {
>>> +         gint width;
>>> +          width = gtk_clist_optimal_column_width (clist, i);
>>> +         gtk_clist_set_column_width (clist, i, width);
>>> +         clist->freeze_count=8;
>>> +         return FALSE;
>>> +        }
>> 
>> Magic numbers, such as "8", should not acceptable in any project.
>> (Disclaimer: I'm not a GTK developer.)
> 
> Normally I would agree, however, I had to keep the patch extremely simple in
> order to be considered.  A simpler solution did not appear possible.

Using the nasty sneaky trick of reusing the freeze_count is reprehensible,
but perhaps necessary.

But there is no excuse for referring to the magic value as "8" instead of
"AUTO_COLUMN_WIDTH_FREEZE_COUNT_HACK" or something like that. I believe that
is the poster's point.

    -- Darin





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