Re: a bunch of issues



> * How do I change the text color in GtkEntry to for example red?

http://pobox.com/~hp/gtk-colors.html

> * Is it possible to force the focus to stay on the widget (GtkEntry) =
>after the user pressed TAB?

handle the key_press and key_release events, return TRUE if the key is
one that you don't want handled by the normal mechanism.

>   I have tried gtk_widget_grab_focus() in "focus-out-event", but got an =
>error.

no ideas.

> * Do both signals and events require gdk_threads_enter() in a =
>multithreaded app?

every single call to any Xlib, glib, gdk or gtk function requires
protection by the mutex. thats because although GTK itself won't cause
multiple calls to handlers etc. during event handling, other threads
may be active and making GTK etc. calls.

> * Does GTK provide functions to check whether the text entered in =
>GtkEntry
>   could be conwerted to some type (i.e. double)? If not, how should I =
>do it in
>   a nice fashion? (checking return value of sscanf() ??)

that's the best i know of. some people have tried to write validating
widgets. my impression is that none of them have been particular
generic. you can also handle the key_press/release events and disallow
(by returning TRUE) the normal entry of "illegal" keys.

--p



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