[Solved]How to add buttons in mainwindow?

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
mea08kw
Posts: 82
Joined: Sun Oct 09, 2022 6:22 am

[Solved]How to add buttons in mainwindow?

Post by mea08kw »

Hi Forum

I'm using the latest version of FreeCAD on Windows 11.

I'm wondering how to add customized buttons in mainwindow.

See attached image as an example, the default rotation tool.

Looking forward to hearing from you.

Best Regards,

Mea08kw
Attachments
example.png
example.png (4.02 KiB) Viewed 1193 times
Last edited by mea08kw on Mon Feb 06, 2023 1:19 am, edited 1 time in total.
User avatar
onekk
Veteran
Posts: 6205
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: How to add buttons in mainwindow?

Post by onekk »

mea08kw wrote: Mon Jan 09, 2023 3:46 am Hi Forum

I'm using the latest version of FreeCAD on Windows 11.

I'm wondering how to add customized buttons in mainwindow.

See attached image as an example, the default rotation tool.

Looking forward to hearing from you.

Best Regards,

Mea08kw
Hello, it is difficult to guess what you are wanting to do.

The navicube is on the "3d view" window.

"3d view" is very different from mainwindow that is usually intended as the main FreeCAD window, that you will obtain using:

Code: Select all

mw = FreeCADGui.getMainWindow()
"3d view" is different from other part of FreeCAD as it is manage by Coin3D (pivy) so it have a totally different behaviour than "Qt based windows".

What do you intend for mainwindow?

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
mea08kw
Posts: 82
Joined: Sun Oct 09, 2022 6:22 am

Re: How to add buttons in mainwindow?

Post by mea08kw »

onekk wrote: Tue Jan 10, 2023 8:18 am
mea08kw wrote: Mon Jan 09, 2023 3:46 am Hi Forum

I'm using the latest version of FreeCAD on Windows 11.

I'm wondering how to add customized buttons in mainwindow.

See attached image as an example, the default rotation tool.

Looking forward to hearing from you.

Best Regards,

Mea08kw
Hello, it is difficult to guess what you are wanting to do.

The navicube is on the "3d view" window.

"3d view" is very different from mainwindow that is usually intended as the main FreeCAD window, that you will obtain using:

Code: Select all

mw = FreeCADGui.getMainWindow()
"3d view" is different from other part of FreeCAD as it is manage by Coin3D (pivy) so it have a totally different behaviour than "Qt based windows".

What do you intend for mainwindow?

Regards

Carlo D.
Hi Carlo

Thanks for your reply.

What I want to do is to put some customized buttons in mainwindow to execute my own python functions(e.g. generating a cube).

In FreeCAD, we could simply add command buttons in toolbar area.

If I could add buttons like "3d view" in mainwindow, I assume the human-software interaction may improve somehow.

Best Regards,

Mea08kw
User avatar
Jolbas
Posts: 330
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Re: How to add buttons in mainwindow?

Post by Jolbas »

mea08kw
Posts: 82
Joined: Sun Oct 09, 2022 6:22 am

Re: How to add buttons in mainwindow?

Post by mea08kw »

Jolbas wrote: Thu Jan 12, 2023 7:14 am Maybe the PieMenu addon is for you.

/viewtopic.php?t=29108
https://github.com/triplus/PieMenu
Thanks a million, Jolbas.

This widget indeed is what I expected.

Maybe its mechanism is different from "3d view" navi cube, anyway it reaches my goal.

Thanks again.

Best Regards,

Mea08kw
Post Reply