Re: [AD] grabber patch to replace an object |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> I didn't particuarly want a hotkey, but feel free to add one if you
> feel it's appropriate. It's not like it's going to be used a lot,
> though it's extremely handy when you need it.
It seems that the only free letter is 'L' !
> > + name = get_datafile_property(dat, DAT_NAME);
> > + sprintf(buf, "%s?", name);
> > + if (alert("Really delete", buf, NULL, "Yes", "Cancel",
> > 'y', 27) != 1)
> > + return D_O_K;
> >
> > 'name' can be the empty string, you need to special-case it.
>
> It works, because get_datafile_property returns "", not NULL, when
> not found (at least last time I checked, but that's months ago).
If you mean that it doesn't crash, sure. But when 'name' is the empty string,
the alert box looks like:
Really delete
?
which is not very nice. "Really delete this item?" would be better.
> Or for cosmetics, how about just adding quotes around the name ?
> (so "" appears for an empty name) ?
Uh... everyone is not a C/C++ programmer :-)
> > What if do_edit() returns FALSE? (Hint: you get an unexpected
> > new file on
> > your disk :-) What if 'prop_type_string' is the empty string?
>
> Do you ? Hmm, I didn't notice :) It just deletes the object on my
> machine, and then does nothing else. But create a new file... Hmm,
> I'll have to check my disk when I get home :)
Try to click "Cancel" on the dialog box and you'll probably get a core file
as I did.
> > return replacer((int)(unsigned long)(active_menu->dp));
>
> Ah. That must be in a lot of other places as well then, because
> I nicked it from the normal deleter routine IIRC.
They have been corrected since then.
--
Eric Botcazou