user1176999
user1176999

Reputation: 470

WxFormBuilder has no Python option

How can I generate python code? I know I need to change code_generation property from C++ to Python, but there is no Python option... How can i fix this? I have already tried looking for this problem on the internet, but I couldn't find anything.

Upvotes: 2

Views: 3485

Answers (3)

Mike Driscoll
Mike Driscoll

Reputation: 33071

UPDATE: FormBuilder added Python support recently. You just need to get version 3.4.x.

In older versions, you weren't able to do this (see below).

According to the wxFormBuilder documentation:

Choose which code will be generated. Currently, you can generate C++ and/or XRC code.

As you can see, the choices are C++ or XRC. There is no Python support at this time. You can use XRC in wxPython. Here are a few links:

Upvotes: 1

Anibalismo
Anibalismo

Reputation: 103

Inside the Object Tree (left panel) you need to select your project (just click on it) and then in the "Object Properties" (rigth panel) go to the code_generation property.

Then select Python.

See the following imageenter image description here

Upvotes: 0

Jessica
Jessica

Reputation: 140

Since you didn't specify your OS, I will just review tips for the 3 major ones.

For Windows, the beta release from wxFormBuilder's SourceForge page, version 3.4.x, is able to generate Python code so perhaps try installing that version. I installed this on my Windows box earlier this year and Python was definitely one of the options.

For Linux, it looks like if you installed wxFormBuilder from your distro's software center or manager, you get an older version of the FB, most likely 3.1.xx, which doesn't generate Python code.

In order to obtain the latest (beta) version which does generate Python code, just add the wxFormBuilder PPA.

First, install wxWidgets 3.0 to obtain the prerequisites for wxFormBuilder:

sudo add-apt-repository -y ppa:wxformbuilder/wxwidgets
sudo apt-get update
sudo apt-get install libwxgtk3.0-0 libwxgtk-media3.0-0

Now, install the latest wxFormBuilder release:

sudo add-apt-repository -y ppa:wxformbuilder/release
sudo apt-get update
sudo apt-get install wxformbuilder

After this, you should have wxFormBuilder 3.4.x and should see options for generating code in Python, Lua, PHP in addition to C++/XRC.

This worked for me, but if it doesn't for you, you can try installing from source. Just take a look at the instructions from the SourceForge page of wxFormBuilder.

For Mac, I do not have first-hand experience but you can try downloading version 3.1 from the regular build page.

Upvotes: 7

Related Questions