Skip to main content

Posts

Showing posts from January, 2015

Cancellation of a 'Recent Items' Pull-Down Menu

Its been some time since support for 'recent file' operations was first added to the Gnocl sources. At the time I was quite pleased with its inclusion but there was always a annoying snag to it, something which is an inhereted feature from the API: if no selection if made, then the last file URI added to the list is always returned. This is not really a sign of anything lacking in the GTK sources, but the documentation does not suggest how to handle any need to CANCEL the menu by pressing the 'ESC' key.  A quick gloss over the docs shows that there is a 'cancel' signal for the MENU-SHELL containing the recent items, but this automatically generates a 'selection-done' signal, the very signal that we want to avoid. The obvious solution for this is to set a boolean cancel flag and test for its TRUE or FALSE state during the execution of any 'selection-done' event handler. For a TCL side solution it was first was necessary to implement a gnocl -on...