gEDA-dev: [PATCH] gschem: Visual feedback for keyboard commands
Peter TB Brett
peter at peter-b.co.uk
Thu May 31 15:51:50 EDT 2007
On Thursday 31 May 2007 20:41:23 Ivan Stankovic wrote:
> On Thu, May 31, 2007 at 07:46:29PM +0100, Peter TB Brett wrote:
> > +gchar *current_keyaccel_string = NULL;
> > +static TOPLEVEL *saved_toplevel = NULL;
> >
> > ...
> >
> > + /* We need to save the toplevel because it may not be
> > + * there anymore when we need to clear the status bar string
> > + * (this occurs with the 'fc' command, for example) */
> > + saved_toplevel = global_window_current;
> >
> >
> > This is a hack. I know the model-view-controller separation in gschem is
> > pretty rubbish, but there must be a better way to handle this without
> > making the situation even worse than it is already. The phrase
> > "maintenance nightmare" comes to mind.
>
> I agree, it is ugly. I removed it completely, but now when you
> press 'fw' now and then go back to the first toplevel, the string
> is still there (it _will_ be cleared on the next keystroke).
> But I guess this is not a big issue. Please see the attached patch.
For a quick nasty hack, why not make the relevant w_current string the data
argument to clear_keyaccel_string?
static gboolean clear_keyaccel_string(gpointer data)
{
g_free(current_keyaccel_string);
current_keyaccel_string = NULL;
i_show_state((TOPLEVEL *) data, NULL);
return FALSE;
}
...
g_timeout_add(400, clear_keyaccel_string, global_window_current);
It'll work, and it will be obvious what's going on.
Peter
--
Fisher Society http://tinyurl.com/o39w2
CU Small-Bore Club http://tinyurl.com/mwrc9
09f911029d74e35bd84156c5635688c0 peter-b.co.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.seul.org/pipermail/geda-dev/attachments/20070531/03138380/attachment.pgp
More information about the geda-dev
mailing list