Re: tab order and restricting entry widgets



On Fri, 14 Jul 2000, Vlad Harchev wrote:

> Date: Fri, 14 Jul 2000 16:38:10 +0500 (SAMST)
> From: Vlad Harchev <hvv@hippo.ru>
> To: Dave Reed <dreed@capital.edu>
> Cc: gtk-list@gnome.org
> Subject: Re: tab order and restricting entry widgets
> 
> On Fri, 14 Jul 2000, Dave Reed wrote:
> 
> > 
> > Is there an easy method to change the focus order when you tab through
> > entry widgets.  I've got a bunch of entry and combo widgets in a table
> > and I want the tab key to go down the column first rather than across
> > the row.  I guess I could use the leave_notify signal for each widget,
> > but that would be a pain.
> 
>  As for focus order - I don't know any easy solution.
>  
> > Is there a way to restrict entry widgets to only numeric (and
> > only dates would be great also)?
> 
>   No special support for this exists, but you always can connect to "changed"
> signal, validate the data, and act accordingly.

That is an easy solution. Connect the signal "changed" in this case for
each widget and supply the next widget as extra data. In the callback,
use gtk_widget_grab_focus((GtkWidget*)data) and this should do the trick.

> I prefer to disable "OK"
> button if data is invalid; coloring the text of the entry with different color
> is nice too.

You mean selecting the whole entry text which is faulty? That is imo a
nice solution.


--
A skunk sat on a stump and thunk the stump stunk,
but the stump thunk the skunk stunk.






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