Hi Antonio
Another observation - it doesn't happen with the first GET on a screen when it first comes up, nor does it happen when you click into a GET, only when you Tab into it.
Doug
Hi Antonio
Another observation - it doesn't happen with the first GET on a screen when it first comes up, nor does it happen when you click into a GET, only when you Tab into it.
Doug
Doug,
It seems that GTK standard behavior is to select all the GET text when arriving to it using Tab. We have tested it with other GTK+ apps, same behavior.
We are asking about it in irc.gnome.org channel #gtk+ to see if there is a way to change it
gtk_widget_queue_draw ()
void gtk_widget_queue_draw (GtkWidget *widget);
Equivalent to calling gtk_widget_queue_draw_area() for the entire area of a widget.
widget :
a GtkWidgetDoug,
Finally! This seems to be what we are looking for:
"gtk-entry-select-on-focus"
It seems as a global setting. Now we need to know how to set that property to false.
We can create a file at home/user folder named
.gtkrc-2.0
and inside have:
gtk-entry-select-on-focus = 0
We may also find how to do it programmatically, probably using gtk_settings_set_property_value()
Anyhow the selected text is gone but there is no blinking cursor! :-S
METHOD GotFocus() CLASS TGet
::SetPos( 0 )
::SetSel( 0, 0 )
return nilgtk_settings_set_property_value ()
void gtk_settings_set_property_value (GtkSettings *settings,
const gchar *name,
const GtkSettingsValue *svalue);Doug,
I got help from the IRC channel and we have it ![]()
No need for the external file. Simply include this line at the bottom of gets.c CREATEGET():
gtk_rc_parse_string( "gtk-entry-select-on-focus = 0" );
its working here! Please check it there ![]()
Hi Antonio
That's wonderful news - and thanks for your effort. Will try it out the moment I get back to my development pc today.
Next step would be to get a HB_FUNC( GETGETSEL ) working so we can replace selected text.
Thereafter there's only one more thing before fivelinux gets 10 out of 10 for me - setting selection in a BROWSE. I don't suppose there's a similar setting?
Regards
Doug
(xProgrammer)
Hi Antonio
Thanks so much. Its working great here. I'm so grateful I'm almost (but not quite) too embarassed to ask for more ... but ... supporting a double click event on a browse would be nice (and make using the software more efficient). Any chance?
A very grateful
xProgrammer
Re catching a double-click event this might help
http://library.gnome.org/devel/gtk-faq/stable/x545.html
Regards
Doug
(xProgrammer)
gtk_rc_parse_string( "gtk-entry-select-on-focus = 0" );#define GTK_ENTRY_NO_SELECT_ON_FOCUSDoug,
The idea is to set it only when we use TGet objects
If we don't use a TGet then there is no need for such setting (?)
Anyhow, we could create a C wrapper to set those settings from PRG level
Hi Antonio
> Anyhow, we could create a C wrapper to set those settings from PRG level
Yes, you're right, that would be the best approach of all. Having it in TGet works fine but it would be better to just call once rather than for every single GET.
Regards
Doug
(xProgrammer)
Hi Antonio
I had a second thought on the above. What if we made it a method of class TWindow. Then it could be called from any of the FiveLinux gui classes by inheritance, couldn't it. That way it could be changed during execution if desired. A single call to the opening TWindow or TDialog object should suffice in most circumstances.
Whilst considering that, isn't that also the best place to put functions controlling color settings. Currently I have them for class TButton because that was the first type of object I needed to control the color of. But now I also want to control the color of objects of class TGet. This can be made to work with the c code sitting in buttons.c because there is no actual tie between button.prg and buttons.c. But color settings can pretty much apply to objects of all the gui classes.
Regards
Doug
(xProgrammer)