Switch between AXIS tabs with GladeVCP button?

More
27 Jan 2019 17:36 #124978 by pferrick
Hi all-

Now that I've got a halfway-decent looking GladeVCP side panel alongside AXIS, I'm wondering how I might go about switching between AXIS tabs by pressing buttons on my panel. On my screen the AXIS tabs themselves are quite small and not very touch-friendly, which is why I'm hoping to select them another way.

I'm pretty sure that some sort of a bridge between Tk and GTK is involved, but since I am a rank beginner at both I have no clear idea of what it might look like.

Thanks very much.

regards,
Patrick

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

More
29 Jan 2019 17:38 #125185 by andypugh
I think that sounds hard. Perhaps making the tabs bigger would be easier?

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

More
29 Jan 2019 18:36 - 29 Jan 2019 18:42 #125191 by BigJohnT
Axis was not designed for a touch screen, Touchy was designed for a touch screen. Axis is a mix of Tcl and Python and not many understand how it works. Axis does use a .axisrc file that will override the Tcl code.

linuxcnc.org/docs/2.7/html/gui/axis.html#_axisrc

And here is the Tcl notebook info, you might get the right command to put in the .axisrc file.

core.tcl.tk/bwidget/doc/bwidget/BWman/NoteBook.html

JT
Last edit: 29 Jan 2019 18:42 by BigJohnT.

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

More
29 Jan 2019 23:15 #125225 by andypugh

Axis was not designed for a touch screen, Touchy was designed for a touch screen.


As was Gmoccapy, and many folk seem to prefer that to Touchy.
(I like the mandatory physical buttons of Touchy, though the lack of graphical preview is a pity)

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

More
30 Jan 2019 01:21 #125238 by cmorley
To answer your original question: surely if is possible using the .axisrc option.
BUT it would require someone to dig into AXIS to figure out how to tease out details to change the tabs. Then probably using HAL pins it would be possible.
We call that kinda 'hacky' :)

AXIS is a good screen but it is difficult to modify - which is a strength and a weakness.

Chris M

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

More
30 Jan 2019 02:20 - 30 Jan 2019 02:24 #125242 by pferrick
Thanks for the input, guys. I have played around with gmoccapy quite a bit and while it's an outstanding effort, I find it to be more difficult to customize than I originally thought. [Of course, customizing _any_ of the available programs is a non-trivial undertaking, no matter how you slice it!]

Anyway, like I said I have a good thing going with my AXIS mods: an array of large, decorated GladeVCP buttons down the right side which handle all sorts of homing, probing (well, almost), MDI, and 7i76-output (via HAL) chores. Super cool. So I figure it's worth an investment of time to try and get them to switch AXIS tabs...that would really round out the whole touchscreen thing nicely.

As an interim "learn some more python / GTK / Tk" experience, I'm now trying to pop up a message dialog in AXIS in response to a GladeVCP button press event. Kind of a Linuxcnc "Hello, world" if you will. Here's what I've tried (that so far hasn't worked):

1. Put a button called hal_btn_probe on my GladeVCP panel (which is pkf_panel.glade)
2. Attached a handler called: on_hal_btn_probe_clicked() to this button.
3. In a file called pkf.py I have this:

def on_hal_btn_probe_clicked(self, widget):
dialog = gtk_message_dialog_new (main_application_window,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"Well, that worked!",
dialog.run()

I also tried this instead, and many variants of it:

def on_hal_btn_probe_clicked(self, widget):
messagebox.showinfo("FYI","Well, that worked!")

4. In this same python file I included the following (there are others that were already there):

import pygtk
import gladevcp
import gladevcp.makepins
from tkinter import *
from tkinter import messagebox

5. Added the panel to AXIS by putting this line in my ini file:

GLADEVCP = -u pkf.py pkf_panel.glade

==========================================================++++++++++++++++++++++++++++++++++++=

Based on everything I've read in the last few days, I was really expecting this to pop up a messagebox, but so far...nada. I'm thinking that if I can get this working I'll have a fighting chance of getting at the Notebook tabs. We shall see!

If anyone has any words of wisdom on this, I'd be very grateful. Heck, I'm already extremely grateful for all the help I've gotten so far...the collective genius of the folks that hang around this forum never ceases to amaze me!

tnx,
patrick
Last edit: 30 Jan 2019 02:24 by pferrick. Reason: parentheses missing

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

More
30 Jan 2019 02:28 #125243 by andypugh

Thanks for the input, guys. I have played around with gmoccapy quite a bit and while it's an outstanding effort, I find it to be more difficult to customize than I originally thought. [Of course, customizing _any_ of the available programs is a non-trivial undertaking, no matter how you slice it!]


Have you looked at Gscreen? That was specifically designed to be customised.

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

More
30 Jan 2019 03:48 - 30 Jan 2019 03:50 #125248 by pferrick

Have you looked at Gscreen? That was specifically designed to be customised.


Yes, I have read over the Gscreen page. It looks pretty good. However, it also looks like approximately the same learning curve as what I'm already going through with AXIS...and as I mentioned, I'm sooooooo close to finished with that! (Plus I've been using AXIS for you-would-not-believe how long (not to mention EMC...!), and I'd like to stick with it if I can. I'll keep ya posted....

Patrick
Last edit: 30 Jan 2019 03:50 by pferrick.

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

More
30 Jan 2019 07:25 #125258 by phillc54

pferrick wrote:
I'm wondering how I might go about switching between AXIS tabs by pressing buttons on my panel.


It can be done using .axisrc. The following example will switch thru the tabs sequentially...

Add a HAL button to your GladVCP panel named 'tab-toggle'

Add the following to your .axisrc file:
Warning: Spoiler!


Add the following to the init section of your python file: (or you could connect the two hal pins in your postgui hal file)
Warning: Spoiler!

You would need to ensure that the hal module is imported into your python file.

Cheers, Phill

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

More
30 Jan 2019 08:00 #125262 by cmorley
hey Phill

You are an AXIS .axisrc expert.
We should collect your code snippets and add it to the official docs.
they are very useful - and probably was a bit of research to figer them out.

Nice job!

Chris M
The following user(s) said Thank You: phillc54, pferrick

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

Time to create page: 0.155 seconds
Powered by Kunena Forum