Re: [gtkmm] focus



I am exploring an other way to to this: knowing that after the focus_out
event, there will be a set_focus made on a window, I replace a callback on
this set_focus event, and re-set_focus on the previous window and widget.
Dirty, but it works. The only trouble I have is that when the user changes
the active window just after editing the entry, I do not receive the
set_focus event. Do you know an event I could grab when the user clicks on
an other window ?

----- Original Message -----
From: "Barnaby Gray" <bee pickle me uk>
To: <gtkmm-list gnome org>
Sent: Sunday, February 09, 2003 1:53 PM
Subject: Re: [gtkmm] focus


> The only place I remember having seen the refocusing for invalid input
> behaviour is in the gtkcombo widget - looking at the sources for this
> in gtk you see they obviously had exactly the same problem, and have
> cheated by instead calling the grab_focus in an idle callback they
> setup in the focus out handler. So you can achieve the same with
> something like:
>
>     Glib::signal_idle().connect(
>       SigC::bind_return(
> SigC::slot( m_entry, &Gtk::Entry::grab_focus ), false ) );
>
> But it's a hack.. and didn't really get the results I wanted in the
> end - I really need some kind of modal lock on that widget until they
> enter valid input..
>
> Barnaby
>
> On Sun, Feb 09, 2003 at 09:10:08AM +0100, erwan ancel wrote:
> > I tried this too... same result :-/
> >
> > ----- Original Message -----
> > From: "Barnaby Gray" <bee pickle me uk>
> > To: <gtkmm-list gnome org>
> > Sent: Sunday, February 09, 2003 12:45 AM
> > Subject: Re: [gtkmm] focus
> >
> >
> > > Was in a similar situation recently: I saw a signal_editing_done()
> > > signal on the base class CellEditable that entry derives from that
> > > looked appropriate, but this didn't work for.. it is never triggered,
> > > anyone know what exactly the point is for this signal?
> > >
> > > Barnaby
> > >
> > > On Sat, Feb 08, 2003 at 11:17:02PM +0100, erwan ancel wrote:
> > > > thanks, but this doesn't match my need. The key release event happen
> > every
> > > > time a key is pressed: this is too often for me.
> > > >
> > > > ----- Original Message -----
> > > > From: "Paul Davis" <paul linuxaudiosystems com>
> > > > To: "erwan ancel" <erwan ancel free fr>
> > > > Cc: <gtkmm-list gnome org>
> > > > Sent: Saturday, February 08, 2003 6:14 PM
> > > > Subject: Re: [gtkmm] focus
> > > >
> > > >
> > > > > >Does somebody know how to deal with focus in the focus_out
callback
> > event
> > > > ?
> > > > > >
> > > > > >I explain my trouble: I am not satisfied of what the user put in
a
> > > > > >Gtk::Entry. On the focus_out event, I want to re-focus on this
entry,
> > but
> > > > it
> > > > > >seems that the Gtk::Window::set_focus(myEntry) doesn't work in
this
> > case.
> > > > > >Maybe because the main loop makes an other set_focus after my
> > callback
> > > > > >function. Does anyone have a solution ?
> > > > >
> > > > > don't use focus_out to validate user entry. use key_release_event.
> > > > >
> > > > > --p
> > > > >
> > > >
> > > > _______________________________________________
> > > > gtkmm-list mailing list
> > > > gtkmm-list gnome org
> > > > http://mail.gnome.org/mailman/listinfo/gtkmm-list
> > > >
> > > >
> > > _______________________________________________
> > > gtkmm-list mailing list
> > > gtkmm-list gnome org
> > > http://mail.gnome.org/mailman/listinfo/gtkmm-list
> > >
> >
> >
> >
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>




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