control gui non-interactively: maximize window

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
teobo
Posts: 410
Joined: Fri Feb 21, 2014 11:23 am

control gui non-interactively: maximize window

Post by teobo »

Hi,
this time I have a not very cad specific question-
1. Are there any facilities to control xlib-qt window of freecad? I mean first: maximizing it.


Sometimes I find it tedious to demonstrate bugs, which are gui related especially user input.
Therefore I thought integrate some gui-automation within test-scripts. I know one could make as well a film, - but a things get more complex it is get even unhandy.
One can use:
import PyMouse
import PyKeyboard
to do such things. And yes -that must be a big mess for those survising screen activities of others. :|

2. One thing that I needed for example was a shortcut that gives focus on the menu bar in the top of the window, so that keyboard stroks can navigate there. (file, Edit) so on. Simply pressing E or F does not work.

Maybe I miss something how to control the gui functionality of freecad. Would be grateful for hints.
Tia
OS: Ubuntu 13.10
Platform: 64-bit
Version: 0.14.3620 (Git)
Branch: master
Hash: bff814b73a0dd469e8a58fd1d7c21852b421b1ea
Python version: 2.7.5+
Qt version: 4.8.4
Coin version: 4.0.0a
SoQt version: 1.5.0
OCC version: 6.7.0
User avatar
teobo
Posts: 410
Joined: Fri Feb 21, 2014 11:23 am

Re: control gui non-interactively: maximize window

Post by teobo »

Code: Select all

#pip install wmctrl
Window.get_active()
a=Window.by_name(wm_name)
b=a[0]
b.resize_and_move(2,2,200,200)
Found something the put one could send a mouse click to the menubar and from there non interactively control the gui-only part of freecad or other window. - There should be more robust solutions - but better then nothing I believe,
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: control gui non-interactively: maximize window

Post by wmayer »

1. Are there any facilities to control xlib-qt window of freecad? I mean first: maximizing it.
Would it be OK to use e.g. PySide and accessing the main window?
2. One thing that I needed for example was a shortcut that gives focus on the menu bar in the top of the window, so that keyboard stroks can navigate there. (file, Edit) so on. Simply pressing E or F does not work.
Depending on the platform pressing ALT+F is the shortcut. On Windows it works but on Ubuntu I don't know because I haven't running it ATM.
User avatar
teobo
Posts: 410
Joined: Fri Feb 21, 2014 11:23 am

Re: control gui non-interactively: maximize window

Post by teobo »

wmayer wrote:
1. Are there any facilities to control xlib-qt window of freecad? I mean first: maximizing it.
Would it be OK to use e.g. PySide and accessing the main window?
2. One thing that I needed for example was a shortcut that gives focus on the menu bar in the top of the window, so that keyboard stroks can navigate there. (file, Edit) so on. Simply pressing E or F does not work.
Depending on the platform pressing ALT+F is the shortcut. On Windows it works but on Ubuntu I don't know because I haven't running it ATM.
Hi wmayer,
yes ALT-F is ok. Thanks
Pyside: I just started to learn Pyside therefore, Thanks for the confirming hint anyway. I got stuck with the tutorial on it.
viewtopic.php?f=22&t=6697
Post Reply