Help Please
- xProgrammer
- Posts: 464
- Joined: Tue May 16, 2006 7:47 am
- Location: Australia
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- xProgrammer
- Posts: 464
- Joined: Tue May 16, 2006 7:47 am
- Location: Australia
Hi Antonio
I hadn't noticed before, but yes that does look like the default. However we are modifying that in the GotFocus() event. That appears to be happening after any default is applied. I say that for two reasons:
1. If you click on the title bar the correct highlighting is shown. So what we have set is still in place at this stage even though it is not reflected on the screen.
2. If that is the cause we can see from inserted calls to ::GetPos() that the select all effect has already taken place when we enter GotFocus() method.
That very much suggests to me that we need to enforce a repaint of the GET at the end of GotFocus() method. I have tried a variety of approaches in the past without success but I do note that self:Refresh() was doomed to failure as it just resets the text. Perhaps we need to call a GTK function such as:
Just one other thing. I('m not sure how our callbacks post their return values, but it looks like we are returning nil? Is that so? Maybe we need to be specific about whether we want further processing and return TRUE or FALSE ?
Regards
Doug
I hadn't noticed before, but yes that does look like the default. However we are modifying that in the GotFocus() event. That appears to be happening after any default is applied. I say that for two reasons:
1. If you click on the title bar the correct highlighting is shown. So what we have set is still in place at this stage even though it is not reflected on the screen.
2. If that is the cause we can see from inserted calls to ::GetPos() that the select all effect has already taken place when we enter GotFocus() method.
That very much suggests to me that we need to enforce a repaint of the GET at the end of GotFocus() method. I have tried a variety of approaches in the past without success but I do note that self:Refresh() was doomed to failure as it just resets the text. Perhaps we need to call a GTK function such as:
Code: Select all
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 GtkWidget
Regards
Doug
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Doug,
Its working fine! As desired!
This code is the right one:
Now we just need to programmatically set that property, without the need of the external file, and we are done
Its working fine! As desired!
This code is the right one:
Code: Select all
METHOD GotFocus() CLASS TGet
::SetPos( 0 )
::SetSel( 0, 0 )
return nil
Last edited by Antonio Linares on Wed Apr 02, 2008 9:38 pm, edited 1 time in total.
- xProgrammer
- Posts: 464
- Joined: Tue May 16, 2006 7:47 am
- Location: Australia
Hi Antonio
Sounds very promising.
This might be the call:
Sounds very promising.
This might be the call:
Code: Select all
gtk_settings_set_property_value ()
void gtk_settings_set_property_value (GtkSettings *settings,
const gchar *name,
const GtkSettingsValue *svalue);
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- xProgrammer
- Posts: 464
- Joined: Tue May 16, 2006 7:47 am
- Location: Australia
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)
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)
- xProgrammer
- Posts: 464
- Joined: Tue May 16, 2006 7:47 am
- Location: Australia
- xProgrammer
- Posts: 464
- Joined: Tue May 16, 2006 7:47 am
- Location: Australia
Re catching a double-click event this might help
http://library.gnome.org/devel/gtk-faq/stable/x545.html
Regards
Doug
(xProgrammer)
http://library.gnome.org/devel/gtk-faq/stable/x545.html
Regards
Doug
(xProgrammer)
- xProgrammer
- Posts: 464
- Joined: Tue May 16, 2006 7:47 am
- Location: Australia
Hi Antonio
Just a thought. Since
seems to be updatinga universal setting (and certainly is not directly attached to any particular object of Class TGet), I was wondering if it might not be better to just stick it in TWindow and TDialog classes.
Perhaps we could use some standard define to activate it so people can program either way. Perhaps if you include
then it is included in any TWindow/TDialog. Or do it the other way around with this as the default behaviour.
Regards
Doug
Just a thought. Since
Code: Select all
gtk_rc_parse_string( "gtk-entry-select-on-focus = 0" );
Perhaps we could use some standard define to activate it so people can program either way. Perhaps if you include
Code: Select all
#define GTK_ENTRY_NO_SELECT_ON_FOCUS
Regards
Doug
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- xProgrammer
- Posts: 464
- Joined: Tue May 16, 2006 7:47 am
- Location: Australia
- xProgrammer
- Posts: 464
- Joined: Tue May 16, 2006 7:47 am
- Location: Australia
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)
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)