Hiding a GladeVCP panel

More
14 Mar 2014 03:04 #44778 by mariusl
Hi,
Is there a way to hide a GladeVCP panel? I want to place a panel on Gmoccapy and only show that panel at certain times when it is required. For all other times it must remain hidden from sight.

Regards
Marius


www.bluearccnc.com

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

More
14 Mar 2014 03:51 - 14 Mar 2014 03:53 #44781 by ArcEye
Replied by ArcEye on topic Hiding a GladeVCP panel
Hi

The glib answer would be Ctrl Alt, or touch that app on the task bar.

I suspect you may be after a programmatical solution, you will have to expand slightly upon what exactly you require

Is this panel embedded or free standing?

regards
Last edit: 14 Mar 2014 03:53 by ArcEye.

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

More
14 Mar 2014 12:57 #44798 by mariusl
Replied by mariusl on topic Hiding a GladeVCP panel
Hi There Mate
I am using a GladeVCP panel that is inserted in a predefined user space on the gmoccapy screen. All the widgets of this panel is placed in a table that is attached to a HAL pin that is used to enable the table or not. Now what I want to do is to attach a HAL pin to the whole panel and hide it completely with the pin. If it is possible at all?

Regards
Marius


www.bluearccnc.com

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

More
14 Mar 2014 14:56 #44803 by ArcEye
Replied by ArcEye on topic Hiding a GladeVCP panel
I see you have an answer on the other thread you posted on.

Basically any widget / window should be able to call hide() and show().
The parent of that window ( that created it and or in which it is embedded ) should be able to also, in fact it just needs the window handle.

Without seeing all the code I can't start to be specific, parsel tongue is not my language of choice

regards

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

More
14 Mar 2014 19:39 #44807 by mariusl
Replied by mariusl on topic Hiding a GladeVCP panel
I got a good answer but that does not mean that I am capable of getting it done. Now finally I have submitted to the pressure and got myself the Learning Python edition 5 handbook.
I was inspired when a friend that is 72 years old told me that he has started learning Python. He has the title of Professor though :)

Regards
Marius


www.bluearccnc.com

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

More
14 Mar 2014 21:42 - 14 Mar 2014 21:42 #44810 by ArcEye
Replied by ArcEye on topic Hiding a GladeVCP panel
Never to old to learn, but you have to find the time somehow. B)

I am not familiar with gmoccapy, but from what you describe, guess you must have something like the left_panel / right_panel set up in the sims

Your starter for 10, from line 779 (in my copy of gmoccapy.py from ~master)

This code gets the dynamic tabs from the ini file and builds them by substituting the {XID} for the real window id of the tab or panel
spawning the process and embedding it in the panel
def _init_dynamic_tabs(self):
        # dynamic tabs setup
        self._dynamic_childs = {}
        # register all tabs, so they will be closed together with the GUI
        atexit.register(self._kill_dynamic_childs)

        tab_names, tab_location, tab_cmd = self.get_ini_info.get_embedded_tabs()
        if not tab_names:
            print (_("**** GMOCCAPY ERROR ****"))
            print (_("**** Invalid embeded tab configuration ****"))
            print (_("**** No tabs will be added! ****"))
            return

        for t, c , name in zip(tab_names, tab_cmd, tab_location):
            nb = self.widgets[name]
            xid = self._dynamic_tab(nb, t)
            if not xid: continue
            cmd = c.replace('{XID}', str(xid))
            child = subprocess.Popen(cmd.split())
            self._dynamic_childs[xid] = child
            nb.show_all()

From there you can determine the handle on the child containing your panel and then manipulate it

have fun
Last edit: 14 Mar 2014 21:42 by ArcEye.

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

More
15 Mar 2014 07:14 #44826 by cmorley
Replied by cmorley on topic Hiding a GladeVCP panel
This can be done a couple of ways, both using the same technique.
gladeVCP allows using a handler file:
www.linuxcnc.org/docs/2.5/html/gui/glade...GladeVCP_Programming

This is the same principal Gmoccapy uses, just bigger, and way more complicated.

So either add a handler file to the gladeVCP panel that makes a HAL pin that will show / hide panel or
do the same to Gmoccapy's handler file.

In the case of gladeVCP panel, you can not hide the parent window, as that is removed when it is embedded into gmoccapy.
You must hide the next widget after the window.

As an aside do you think adding a container widget to gladeVCP that has a HAL pin to show / hide would be useful?
same idea as the HAL_Sensitive_Table...

Chris M

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

More
15 Mar 2014 13:12 #44830 by mariusl
Replied by mariusl on topic Hiding a GladeVCP panel
Hi Chris
Thanks for the info. I am using the hal sensitive table at the moment but that only disables the widgets. I want to hide them all together so that the screen is not cluttered. There are three custom boxes provided in Gmoccapy to add such panels but the area to put them into is not sufficient. So the idea that I have is that one should be able to call these panels up when the functions are required and then hide them again to only have the standard stuff showing. Typical use is for tool change.

I will read the guide some more.

Regards
Marius


www.bluearccnc.com

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

More
15 Mar 2014 13:42 #44831 by mariusl
Replied by mariusl on topic Hiding a GladeVCP panel
The samples that the GladeVCP guide refer to does not exist in the configs directory anymore. Is there some other place that it could be found?

Regards
Marius


www.bluearccnc.com

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

More
15 Mar 2014 13:51 #44832 by cmorley
Replied by cmorley on topic Hiding a GladeVCP panel
So now I think you want to show / hide a panel that displays over top of Gmoccapy (not embedded). yes?
sort of like a dialog box.

If fullscreen (no menu bars showing) is important to you, then this is difficult without editing Gmoccapy's hander file.

If no-menu-bars-showing is not so important then using a handler file on a regular gladeVCP panel is the way to go,
though since it's NOT embedded then you will need to show / hide the top level window.

What exactly are you displaying in the panel?

There are quite a few details needed to get this right.

Chris M

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

Moderators: HansU
Time to create page: 0.102 seconds
Powered by Kunena Forum