On Sun, 24 Jan 1999, Alexander Larsson spake thusly:

> 
> I've done some closer reading:
> 
>> /* This contains the point that was clicked to get this menu */
>> Point *object_menu_clicked_point;
>> 
>> void
>> popup_object_menu(GdkEventButton *bevent, DDisplay *ddisp)
>> {
>>   Diagram *diagram;
>>   real click_distance;
>>   Object *obj;
>>   Point *clickedpoint;
> 
>  Pointer here. Not initialized.

That's bad.  That was actually it.

>>   GtkMenu *menu = NULL;
>>   GList *selected_list;
>> 
>> printf("Trying a middle menu\n");
>> 
>>   diagram = ddisp->diagram;
>>   if (diagram->data->selected_count != 1) return;
>>   selected_list = diagram_get_sorted_selected(diagram);
>>   /* Have to have exactly one selected object */
>>   if (selected_list == NULL || g_list_next(selected_list) != NULL) {
>>     message_error("Selected list is %s while selected_count is %d\n",
>>                (selected_list?"long":"empty"), diagram->data->selected_count);
>>     return;
>>   }
>>   obj = (Object *)g_list_first(selected_list)->data;
> 
>  How come you use the selected object, and not the 'closest' to the
>  point the user clicked?

After a bit of thought, that seemed more natural.  The middle menu then
always operates on the selected object.

>  I've commented some stuff. The mem clobber is serious, but i can't
>  understand why it grabs focus and won't let go.

Me neither, but that's what it does.

-Lars

-- 
Lars R. Clausen ([EMAIL PROTECTED])
A *real* smart bomb would call in sick, perhaps move to another country,
changing its name in the process, open a beach bar maybe and live out its
days in safe anonymity.                          -- Barry O'Neill in rhod

Reply via email to