|
|
|
|
|
by ivanbakel
1991 days ago
|
|
Because the event says "open the currently selected file", not "open this file because it is the selected one". If the event is processed asynchronously w.r.t. other events which can modify the selection, you can get buggy behaviour. I don't find such a design that surprising. If you like simplicity, you would be tempted to go for it, because it doesn't involve duplicating data (namely, the selected filepath) between the main GUI state and the event handler for opening the selected file. If you're writing in a memory-managing language like C, it's even more tempting - by not copying data, you don't risk forgetting to free it later. |
|