[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gEDA-dev: [PATCH] gschem: Visual feedback for keyboard commands



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

PGP signature



_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev