Changing the openGL colors in the Axis GUI

More
15 Apr 2012 18:17 - 15 Apr 2012 18:39 #19222 by loboy
JR,

Yes, I agree that the axis.tcl file is hard to follow. I started out my revamp just like you, with absolutely zero knowledge of TCL. I spent the majority of my time commenting out the code and cleaning it up, making it easier to manipulate.


Most of the elements do not have attributes and use the default values assigned by TCL, and have to be added in order to change their appearance. My example elements may not be named exactly the same, but it should give you an idea.

Here is an example with attributes:
frame .gcodepanel.readout 
	-borderwidth 0 
	-highlightthickness 1 
	-highlightcolor "#000000" 
	-highlightbackground "#000000" 

Using the search function in gedit is very helpful in determining how all the elements are linked together.

Here is an example of a restyled button:
Button .controls.toolbar.estop 
        -activebackground "#ff0000" 
        -background "#ff0000" 
	-helptext [_ "Toggle Emergency Stop [F1]"] 
        -borderwidth 5 
	-font "Helvetica 12" 
	-height 2 
	-width 6 
	-highlightthickness 1 
	-highlightcolor "#000000" 
	-highlightbackground "#000000" 
	-takefocus 0 
	-padx 5 
	-pady 5 

Remember, my element names will not be the same as the original axis.tcl code.

For some reason the forum is not allowing backslashing in the code sections. Each attribute line break must end with a backslash.
Last edit: 15 Apr 2012 18:39 by loboy.

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

More
15 Apr 2012 18:39 #19223 by loboy
Oh, and be sure to backup your original.

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

More
15 Apr 2012 18:51 - 15 Apr 2012 18:53 #19224 by loboy
JR,

So I think to change the original gcode background you have to go to around line 1517 and add background color attributes to the first element, and a foreground color attribute to the second element:
frame ${pane_bottom}.t 
	-borderwidth 2 
	-relief sunken 
	-highlightthickness 1 
        -background "#000000"

text ${pane_bottom}.t.text 
        -foreground "#ffffff" 
	-borderwidth 0 
	-exportselection 0 
	-height 9 
	-highlightthickness 0 
	-relief flat 
	-takefocus 0 
	-yscrollcommand [list ${pane_bottom}.t.sb set]
${pane_bottom}.t.text insert end {}

Remember the backslashes...
Last edit: 15 Apr 2012 18:53 by loboy.
The following user(s) said Thank You: Hearty

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

More
15 Apr 2012 20:32 #19226 by JR1050
Thank you!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! If you are ever in FL.look me up,cold ones and BBQ on me!!

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

More
16 Apr 2012 04:08 - 16 Apr 2012 04:22 #19232 by dgarrett
# Many configuration changes can be put in your ~/.axisrc file
# and do not require modifying (nor maintaining) axis.tcl. Reading
# the axis.tcl and axis.py files is useful in determining widget names
# and options. The Tk man pages for widgets will show all options
# available for a given widget (button, scrollbar, text, etc).

# For example: $ cat ~/.axisrc

root_window.tk.call(pane_bottom+".t.text","configure"
,"-background","black")
root_window.tk.call(pane_bottom+".t.text","configure"
,"-foreground","steelblue1")

root_window.tk.call(".toolbar.machine_estop","configure"
,"-image",""
,"-text","ESTOP"
,"-activebackground","red"
,"-background","red"
,"-helptext","Toggle Emergency Stop [F1]"
,"-borderwidth","5"
,"-font","Helvetica 12"
,"-height","2"
,"-width","6"
,"-highlightthickness", 1
,"-highlightcolor","black"
,"-highlightbackground","black"
,"-takefocus",0
,"-padx",5
,"-pady",5
);


# In this example, the colors of the gcode text pane are modified
# per an earlier suggestion.

# ( Using named colors may be simpler than hex codes like #ff0000.)
# (Use the xcolors utility to show standard X color names.)

# Then, the estop button is modified by removing the
# image, adding text, and setting other configuration options
# as outlined in earlier posts.

# The .axisrc commands must have no errors and some
# escape sequences may be required, e.g., for quotes
# embedded in quotes

# Beware that future releases may change the names of widgets
# or have other side effects.
Last edit: 16 Apr 2012 04:22 by dgarrett. Reason: backslash escapes not handled properly on display
The following user(s) said Thank You: Hearty

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

More
12 May 2016 22:40 #74574 by probotix
Do you care to share your code for this?

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

More
16 May 2016 18:27 #74765 by loboy
Hi Probotix,

I made extensive changes to Axis and LinuxCNC, and I think LinuxCNC has moved on to a new version of Ubuntu. I am still on the previous legacy version of Ubuntu, I forget the version number, but I just know the long term support has ended on my version.

As far as sharing the code goes, I think I would have to make a full on distribution, with which I am not that familiar. My modifications were pretty much kept to Axis, but Axis uses other parts of certain python modules and tcltk parts which I did modify. I kept some notes but I am unclear as to how this would affect other front end parts of LinuxCNC. The changes were mostly cosmetic and had to do with the rendering of the GUI, but I just don't know. In addition, I ripped out a lot of code others might find useful, like the tab system, and I never tested Axis in its lathe mode, using kinematics, or with more than 4 rotational axises (axii?).

Otherwise, I have been using this front end now for about four years and I haven't run into any problems on my machine. Funny thing is, I use a Probotix motor controller on my machine as well as their stepper motors. Are you affiliated with Probotix at all?

Let me know what you think, and if I can help in any other way.

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

More
16 May 2016 19:21 #74771 by probotix
Yes,, as a matter of fact I am the owner of probotix. I too have been working on the Axis interface on an older version (2.5). I dont have any need for merging in with the current code base necessarily, but if I did, I would make it Axis2 or something, as I want a very simplified interface without the use of coordinate systems or offsets or any of the other power user features that tend to confuse the average guy who just makes little plaques that say "I love you, honey."

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

More
16 May 2016 22:22 #74783 by loboy
It is nice to meet you.

I just do not know the proper procedure for packaging up the changes I made and releasing them. I did fork the Axis program into Praxis (Practical Axis) on my OS, but again there are files linked all over the place, and trying to unravel it was somewhat complicated. For instance, the scrollbars are tied into TKTCL parts, some dialogue windows are tied into certain pymodules, etc. Spaghetti...At the time, I was very surprised I couldn't find a block diagram of how the program actually functioned.

It just isn't a simple binary package that one can download and install. Really wish was it was though, but I don't have that knowledge and or time. This is what always bugged me about Linux in general, dependencies... Or maybe I am just naive in this regard.

I know other people would like to try this interface, but I would need some guidance as to how to proceed.

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

More
22 May 2016 13:21 - 22 May 2016 13:23 #74946 by Cheech
Maybe just post the Axis.tcl and axis.py files? Did you alter anything else?

I did play a bit with the tcl file... not easy if you don't know tcl.

One thing I can't understand is how come we don't have a GoToZero button under axis.

It would be amazing if LCNC had a screen editor like Mach3/4 have.. easy to do screen edits and very powerful.
Last edit: 22 May 2016 13:23 by Cheech. Reason: further explain

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

Time to create page: 0.116 seconds
Powered by Kunena Forum