[solved]Axis for 800x480 screen w/ usercommand
28 Apr 2022 22:56 #241580
by andypugh
Replied by andypugh on topic [solved]Axis for 800x480 screen w/ usercommand
That's quite cute. Though I rather feel that tiny screens are a false economy.
Please Log in or Create an account to join the conversation.
04 May 2022 00:37 #241956
by cakeslob
thats what I have been trying to do since I started. layout wise it makes sense regardless of screen size,
The problem Im having is I cannot move the gcode widget to the tabs portion. Thats why I have the button on the side to switch from manual to gcode. otherwise I have a screen that is exactly that sans the tabs, it took me a little to realize it was photoshopped. Ill post the version closest to your proposal, I just need to update it to python3.
Not that it cannot be done, but my project is based in usercommand file for versatility , and modifying axis at a source level would mean maintaining it every update, and its a pain in he ass for users if theres a version mismatch. Something Im not willing to do. I draw a hardline at the usercommand file.
To make it work in usercommand file, I think the gcode widget would need to be remade as a new widget, and placed into the tab as a new widget. A considerable undertaking with my computer ability, because there is a lot going on in the gcode window.
Unless a pro knows how we can somehow clone/mirror/parallel a widget inside of tkinter, like something that would re-direct everything from gcode old to gcode new.
Thats only the case if cost is your main metric, or if you are using a pc. Size is my main metric because most of my machines fit inside a 300x300mm footprint. and older/basic pc monitors only support vga
Replied by cakeslob on topic [solved]Axis for 800x480 screen w/ usercommand
Proposal for forum.linuxcnc.org/21-axis/38188-solved-...mand?start=20#217294
thats what I have been trying to do since I started. layout wise it makes sense regardless of screen size,
The problem Im having is I cannot move the gcode widget to the tabs portion. Thats why I have the button on the side to switch from manual to gcode. otherwise I have a screen that is exactly that sans the tabs, it took me a little to realize it was photoshopped. Ill post the version closest to your proposal, I just need to update it to python3.
Not that it cannot be done, but my project is based in usercommand file for versatility , and modifying axis at a source level would mean maintaining it every update, and its a pain in he ass for users if theres a version mismatch. Something Im not willing to do. I draw a hardline at the usercommand file.
To make it work in usercommand file, I think the gcode widget would need to be remade as a new widget, and placed into the tab as a new widget. A considerable undertaking with my computer ability, because there is a lot going on in the gcode window.
Unless a pro knows how we can somehow clone/mirror/parallel a widget inside of tkinter, like something that would re-direct everything from gcode old to gcode new.
That's quite cute. Though I rather feel that tiny screens are a false economy.
Thats only the case if cost is your main metric, or if you are using a pc. Size is my main metric because most of my machines fit inside a 300x300mm footprint. and older/basic pc monitors only support vga
The following user(s) said Thank You: HansU
Please Log in or Create an account to join the conversation.
08 May 2022 09:54 #242295
by HansU
I agree on that.
Replied by HansU on topic [solved]Axis for 800x480 screen w/ usercommand
Not that it cannot be done, but my project is based in usercommand file for versatility , and modifying axis at a source level would mean maintaining it every update, and its a pain in he ass for users if theres a version mismatch. Something Im not willing to do. I draw a hardline at the usercommand file.
I agree on that.
Please Log in or Create an account to join the conversation.
09 May 2022 02:25 - 09 May 2022 04:04 #242343
by phillc54
Most widgets that appear in the widget list can be "moved" by recreating the list:
github.com/LinuxCNC/linuxcnc/blob/3b17ed...cripts/axis.py#L1314
The gcode text needs a bit more work than most because widget.text is assigned as t so it needs reassigning after creating the new widget. The following code shows this way of moving the gcode text to a new auto tab:
I must admit that I have not spent a lot of time testing but it appears to work ok.
Replied by phillc54 on topic [solved]Axis for 800x480 screen w/ usercommand
To make it work in usercommand file, I think the gcode widget would need to be remade as a new widget, and placed into the tab as a new widget. A considerable undertaking with my computer ability, because there is a lot going on in the gcode window.
Most widgets that appear in the widget list can be "moved" by recreating the list:
github.com/LinuxCNC/linuxcnc/blob/3b17ed...cripts/axis.py#L1314
The gcode text needs a bit more work than most because widget.text is assigned as t so it needs reassigning after creating the new widget. The following code shows this way of moving the gcode text to a new auto tab:
Warning: Spoiler!
rC = root_window.tk.call
# remove bottom pane
rC('.pane','forget','.pane.bottom')
# new auto tab with gcode text
rC('.pane.top.tabs','insert','end','auto','-text',' Auto ')
rC('.pane.top.tabs.fauto','configure','-borderwidth',2)
rC('frame','.pane.top.tabs.fauto.t','-borderwidth',2,'-relief','sunken','-highlightthickness','1')
rC('text','.pane.top.tabs.fauto.t.text','-borderwidth','0','-exportselection','0','-highlightthickness','0','-relief','flat','-takefocus','0','-undo','0')
rC('bind','.pane.top.tabs.fauto.t.text','<Configure>','goto_sensible_line')
rC('scrollbar','.pane.top.tabs.fauto.t.sb','-width',20,'-borderwidth','0','-highlightthickness','0')
rC('.pane.top.tabs.fauto.t.text','configure','-yscrollcommand',['.pane.top.tabs.fauto.t.sb','set'])
rC('.pane.top.tabs.fauto.t.sb','configure','-command',['.pane.top.tabs.fauto.t.text','yview'])
rC('pack','.pane.top.tabs.fauto.t.sb','-fill','y','-side','right')
rC('pack','.pane.top.tabs.fauto.t.text','-expand','1','-fill','both','-side','left')
rC('pack','.pane.top.tabs.fauto.t','-fill','both')
# create a new widget list so we can "move" the gcode text
widget_list_new =
for widget in widget_list:
if '.t.text' in widget[2]:
widget = ('text', Text, '.pane.top.tabs.fauto.t.text')
widget_list_new.append(widget)
widgets = nf.Widgets(root_window,*widget_list_new)
# copied from axis.py (line 3857) to assign the "new" widgets.text to t
t = widgets.text
t.bind('<Button-3>', rClicker)
t.tag_configure("ignored", background="#ffffff", foreground="#808080")
t.tag_configure("lineno", foreground="#808080")
t.tag_configure("executing", background="#804040", foreground="#ffffff")
t.bind("<Button-1>", select_line)
t.bind("<Double-Button-1>", release_select_line)
t.bind("<B1-Motion>", lambda e: "break")
t.bind("<B1-Leave>", lambda e: "break")
t.bind("<Button-4>", scroll_up)
t.bind("<Button-5>", scroll_down)
t.configure(state="disabled")
I must admit that I have not spent a lot of time testing but it appears to work ok.
Last edit: 09 May 2022 04:04 by phillc54. Reason: Remove a redundant line
Please Log in or Create an account to join the conversation.
09 May 2022 03:58 #242347
by cakeslob
Replied by cakeslob on topic [solved]Axis for 800x480 screen w/ usercommand
Phil, you wizzard, thank you so much! Thats a gamechanger for me. Just gonna start from scratch around this now.
Everything works great so far, all the gcode scrolling things i use are all normal, the only issue was it loads the default gcode into bottom.t.text, and you can run the file without anything showing up on the new gcode window. This got fixed when I added the optional loadlast file portion, so now it loaded the default gcode into the new window the same as before
I see, I didnt have to move or redirect bottom.t.text, just change the widget list to the new one, and redo all the bindings/config
The first part I get, its making the new tab, making the new text
The third part I get, its redoing all the configs and key binds and stuff
The second part I love and would not have got in a million years
Ok awesome this part I understand and I love, so you changed the third item down on the widgets list to be the new text widget
Now you change widgets to the new appended widgets list, Im pretty sure I understand whats going on.....
The part I dont understand is the button frame. I recognize that from plasmac, so did that also add it to the widget list?
Everything works great so far, all the gcode scrolling things i use are all normal, the only issue was it loads the default gcode into bottom.t.text, and you can run the file without anything showing up on the new gcode window. This got fixed when I added the optional loadlast file portion, so now it loaded the default gcode into the new window the same as before
I see, I didnt have to move or redirect bottom.t.text, just change the widget list to the new one, and redo all the bindings/config
The first part I get, its making the new tab, making the new text
The third part I get, its redoing all the configs and key binds and stuff
The second part I love and would not have got in a million years
# create a new widget list so we can "move" the gcode text
widget_list_new = []
for widget in widget_list:
if '.t.text' in widget[2]:
widget = ('text', Text, '.pane.top.tabs.fauto.t.text')
Ok awesome this part I understand and I love, so you changed the third item down on the widgets list to be the new text widget
widget_list_new.append(widget)
widget_list_new.append(('buttonFrame', Frame, '.fbuttons'))
widgets = nf.Widgets(root_window,*widget_list_new)
Now you change widgets to the new appended widgets list, Im pretty sure I understand whats going on.....
The part I dont understand is the button frame. I recognize that from plasmac, so did that also add it to the widget list?
The following user(s) said Thank You: phillc54
Please Log in or Create an account to join the conversation.
09 May 2022 04:01 #242348
by phillc54
Replied by phillc54 on topic [solved]Axis for 800x480 screen w/ usercommand
Oops, the button frame can go, it is just part of something I am playing around with for a Pi4.
The following user(s) said Thank You: cakeslob
Please Log in or Create an account to join the conversation.
09 May 2022 04:52 #242352
by cakeslob
Replied by cakeslob on topic [solved]Axis for 800x480 screen w/ usercommand
no no, please
what i wanted for this project from the start was gcode in the tabs for size, and then copy everything from plasmac to make it 'regular'mac with the button frame and the orientation stuff. And the gcode search thing. Thanks again
I need to work on the size but heres what I got, the same thing you posted + loadlast to fix initial loaded file, only for 2.9
what i wanted for this project from the start was gcode in the tabs for size, and then copy everything from plasmac to make it 'regular'mac with the button frame and the orientation stuff. And the gcode search thing. Thanks again
I need to work on the size but heres what I got, the same thing you posted + loadlast to fix initial loaded file, only for 2.9
Please Log in or Create an account to join the conversation.
09 May 2022 05:00 #242354
by phillc54
Replied by phillc54 on topic [solved]Axis for 800x480 screen w/ usercommand
That looks good, I did similar with the active gcodes and moved them down to the "status bar".
Please Log in or Create an account to join the conversation.
11 May 2022 03:33 #242567
by cakeslob
Replied by cakeslob on topic [solved]Axis for 800x480 screen w/ usercommand
Im surprised how fast everything came into the right size, I only needed to add like 15 lines. Need to fix a few things, and I cannot remember shit how I did everything the first time, trying to get it to resize automatically is now the hard part. it resizes it self once you click the window, but not load to size. Without re/moving to much, everything came out at 740x470 so far. Big thanks again to phil.
The following user(s) said Thank You: HansU
Please Log in or Create an account to join the conversation.
11 May 2022 05:44 #242572
by HansU
Replied by HansU on topic [solved]Axis for 800x480 screen w/ usercommand
This looks really great now and should definitely go in master.
I would suggest to add it as a sample configuration for axis.
Cakeslob would you like to commit it yourself, or would you like someone else to do that?
I would suggest to add it as a sample configuration for axis.
Cakeslob would you like to commit it yourself, or would you like someone else to do that?
Please Log in or Create an account to join the conversation.
Time to create page: 0.159 seconds