Setting focus on a list

More
29 Apr 2023 21:26 #270238 by Vmax549
Setting focus on a list was created by Vmax549
Hi Guys once again I am back working on switching pages via hotkey. The switching itself is working great.  The Project now is to get it to set focus on the Tool table or Work table.  I do know that it uses a treeview to display in a scrolled window and the treeview dispalys the Tool_liststore which is built from the Tool data file. I do know that they set focus on a mouse press click or release click that is obvious.

But I don't find how they set focucs on the treeview. I have not found that part yet

Do any of yall know how they do it ??

(;-) TP

Please Log in or Create an account to join the conversation.

More
29 Apr 2023 22:44 #270254 by Vmax549
Replied by Vmax549 on topic Setting focus on a list
I had thought that this would do the trick but no luck thus far

self.tool_treeview.set_cursor(row,column,start_edit)

useage: self.tool_treeview.set_cursor(row +1 ,tool_description_column,True)

(;-) TP

Please Log in or Create an account to join the conversation.

More
29 Apr 2023 22:48 - 29 Apr 2023 22:49 #270255 by Vmax549
Replied by Vmax549 on topic Setting focus on a list
Also found:
self.tool_table_update_focus( row +1,tool_description_column,False)

But nodda (;-) TP
Last edit: 29 Apr 2023 22:49 by Vmax549.

Please Log in or Create an account to join the conversation.

More
30 Apr 2023 04:04 #270288 by Vmax549
Replied by Vmax549 on topic Setting focus on a list
OK I figured out teh Tool Table focus now on to the work table focus. It seems to be a different method.

(;-) TP

Please Log in or Create an account to join the conversation.

More
30 Apr 2023 20:51 #270335 by snowgoer540
Replied by snowgoer540 on topic Setting focus on a list
ui_misc.set_current_notebook_page_by_id(self.notebook, 'notebook_offsets_fixed')
ui_misc.set_current_notebook_page_by_id(self.offsets_notebook, 'work_offsets_fixed')
self.work_treeview.grab_focus()

Seems to do the trick!

Please Log in or Create an account to join the conversation.

More
30 Apr 2023 20:54 #270336 by snowgoer540
Replied by snowgoer540 on topic Setting focus on a list
Similarly, for the tool table, this works:
ui_misc.set_current_notebook_page_by_id(self.notebook, 'notebook_offsets_fixed')
ui_misc.set_current_notebook_page_by_id(self.offsets_notebook, 'tool_offsets_fixed')
self.tool_treeview.grab_focus()

Please Log in or Create an account to join the conversation.

More
01 May 2023 00:40 #270357 by Vmax549
Replied by Vmax549 on topic Setting focus on a list
Interesting, I never thought of that approach. I was using PP functions to do it. The one for the tool table focus worked but I never could get the work table focus to work.

Do yo have a feature to focus on the Gcode list ?

Thanks For your time (;-) TP

Please Log in or Create an account to join the conversation.

More
01 May 2023 00:59 #270358 by snowgoer540
Replied by snowgoer540 on topic Setting focus on a list
assuming you mean the gcode on the main tab?

If so, this would probably work:
ui_misc.set_current_notebook_page_by_id(self.notebook, 'notebook_main_fixed')
ui_misc.set_current_notebook_page_by_id(self.gcode_options_notebook, 'gcode_page_fixed')
self.sourceview.grab_focus()

The trouble is that you cant use the arrow keys in that window to move up and down. It will instead jog the axes. I did email tormach and make them aware that there are several places where one would expect to be able to use the arrow keys to move up and down in the text of a window rather than jog. This was one of the places. They said they would look into it...

Please Log in or Create an account to join the conversation.

More
01 May 2023 01:10 #270360 by Vmax549
Replied by Vmax549 on topic Setting focus on a list
Yes I know about the lack of up/down but I had planned on a button to interact with the slider up down buttons one up and one down or up = up and shift up = down.

I do believe I will limit how much key interaction is involved as it get complicated try to figure out all the functions and interactions. To make this really usefull it would have to planned this way from the begining possible using TAB. OR with Fkeys active on the page they represent. But I see Tormach blocked useing the TAB key for a reason ??? Probably could still use Fkeys to move about the page with each page having their own Fkeys active only when on that page.

IF you want to see a true button controlled controller look at CENTROID. One of the easiest to use controllers made. But that ease cost $$$$$$.

(;-) TP

Please Log in or Create an account to join the conversation.

More
01 May 2023 01:18 #270361 by Vmax549
Replied by Vmax549 on topic Setting focus on a list
HUM interesting. Turn OFF the numlock and use the arrows in the KP side. Up an down works here.

(;-) TP

Please Log in or Create an account to join the conversation.

Time to create page: 0.072 seconds
Powered by Kunena Forum