问题标签 [wxformbuilder]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
291 浏览

wxpython - 在 wxFormBuilder 中为属性使用变量而不是常量

在诸如 spinctrl 或滑块框之类的小部件中,可以将初始位置、最小值和最大值等属性设置为常量。有什么方法可以将它们指定为变量。

所以代码

变成

这将允许在显示对话框之前在运行时设置参数。

0 投票
1 回答
845 浏览

python - wxFormBuilder 与 Python:从子类访问 FlexGridSizer

我正在 wxFormBuilder 中构建一个 GUI,并在 Python 中为其编写代码。

我注意到我构建的所有小部件都分配给self生成的代码。例如,带有单个文本的 GUI 可能如下所示:

所以对象myStaticText成为MyFrame类的属性。这很好,因为我可以编写一个继承这个类的新类,然后执行其他功能,例如更新myStaticText对象:

问题是 wxFormBuilder 没有self在任何 FlexGridSizer 对象前面附加 a 。所以生成的代码如下:

代替:

结果,我无法从任何其他类访问该对象,而我确实需要这样做。

所以...

  1. 有没有办法从另一个类访问一个对象,如果它self前面没有,即使我直接继承它?
  2. 有没有办法更改 wxFormBuilder 中的设置,以便它附加self?
0 投票
1 回答
684 浏览

c++ - 如何通过c ++在wxWidgets中显示来自互联网的图像?

wxStaticBitmap我在 wxFormBuilder 制作的表单上添加了一个:

如何使用 C++ 和 Curl 在其上显示基于 Internet 的图像?例如,像这样的图像:

https://www.google.com/images/srpr/logo4w.png

0 投票
3 回答
4703 浏览

python - 如何在 Mac 上构建 wxFormBuilder 3.x

我将wxFormBuilder 3.4 beta mac下载到适当的目录。

在此处输入图像描述

并打开一个我运行的终端,sh create_build_files4.sh但控制台向我显示以下错误。

我的环境是 OS X Mountain Lion(也是 Mavericks)。我已经安装wxPython的版本是 2.9.5。

我的问题是什么?...谷歌,永远不要向我显示提示。

预先感谢。

编辑

我安装了 wxWidgets 3.0 并放置了 premake4。我认为它似乎几乎接近解决。wxFormBuilder 使用 lua 脚本。但我不知道 solution.lua 脚本构建代码。任何提示?请参阅下面的 shell create_build_files4.sh 脚本。一件事是一定要知道solution.lua的脚本代码。

0 投票
3 回答
3246 浏览

python - WxFormBuilder 没有 Python 选项

如何生成python代码?我知道我需要将 code_generation 属性从 C++ 更改为 Python,但是没有 Python 选项......我该如何解决这个问题?我已经尝试在互联网上寻找这个问题,但我找不到任何东西。

0 投票
2 回答
10554 浏览

python - TypeError: __init__() takes at least 3 arguments (1 given)

This is my code for a GUI :

I'm getting the

on the 3rd last line frame = MainWindow()

How do I make sure the parameter list matches? I think I'm a little confused on passing self, parent or something.

Help please!

EDIT: @mhlester : I made the change you suggested but now I have a different error :

Infact this is what the complete text looks like :

0 投票
2 回答
3184 浏览

button - 如何在 WxFormBuilder 中移动按钮

我一直在玩 WxFormBuilder,但我一直坚持如何完成将按钮定位在屏幕不同位置的简单任务。现在最直观的事情是拖放,但 WxFormBuilder(遗憾的是)没有这个功能。

0 投票
1 回答
253 浏览

python-2.7 - wxPython - adding new objects in an inherited Class?

I am not a complete beginner, but I am by no means an expert (perhaps I know enough to be dangerous? :) ). I tried googling an answer and doing my own troubleshooting for about 2 hours before posting this. There may well exist an explanation for this, I might be using the wrong terminology. Hopefully I have explained the issue well enough below.

I've been using wxFormBuilder to manage the GUI aspects of my applications and all has been going well. However I now need to add a WebView object, which is not catered for in the menu of objects that can be added using wxFormBuilder.

For overcoming this, I thought that I should be able to specify the missing object in the Inherited class file and then write a line to have it added to an existing Sizer that is defined in the Generated class file. I considered manually adding it to the Generated code file, but if I need make changes and regenerate the file, I would lose the code I manually wrote.

Creating the new WebView object in the Inherited Class is fine, but I cannot work out how to reference the Sizer in order to add it.

Here is an excerpt from my Inherited Class

And from my Generated Class (just showing the definiton of "mySizer" etc)

I have various ways of referencing mySizer in the Inherited Class, but have failed to workout the correct way to reference it.

I initially thought to try it as in the Generated Class:

but this gives "NameError: global name 'mySizer' is not defined".

I then tried various combinations of referencing prefixes, none of which worked:

Thanks in advance for any assistance.

0 投票
2 回答
2948 浏览

python - 如何修复来自 wxPython/wxFormBuilder 的“'wxPyXmlSubclassFactory *' 类型的内存泄漏,未找到析构函数”错误?

我正在尝试按照本教程使用 wxPython 和 wxFormBuilder 快速制作简单的 GUI。

使用 wxFormBuilder,我创建了一个超级简单的框架,一个垂直布局,一个编辑文本控件和一个按钮,它只清除文本控件的值。WxFormBuilder 生成了 Python 代码,我只是添加了几行来在单击按钮时清除文本控件的值。这是愚蠢的简单框架的图像。

简单的框架

当我在 Python 中运行此文件时,GUI 会清除我在文本控件中键入的文本。当我单击 Frame 的关闭按钮时,我看到:

swig/python detected a memory leak of type 'wxPyXmlSubclassFactory *', no destructor found.

我尝试用谷歌搜索这个问题,但只发现 Python 足够动态,不需要析构函数。我确实尝试添加该__del__功能,但仍然收到相同的错误消息。

摆脱该错误的想法?我在用着:

  • Python 2.7.6
  • 用于 Python 2.7 的 wxPython 3.0.0.0
  • wxFormBuilder 3.4.2
  • Windows 7,32 位

非常感谢您!

如果有人需要,这是我的代码:

0 投票
2 回答
4811 浏览

python - wxPython/ReportLab:如何在单击按钮时创建和打开 .pdf 文件

大家好,大约 3 天以来,我一直在努力解决这个问题!我有一个完美运行的 wxFrame 以及一个完美运行的 ReportLab pdf 脚本。分别参见下面的代码文件(注意:data1.py 是 GUI,而 data2.py 是正在运行的 pdf 脚本)。我的问题是:- 1)我希望 pdf 脚本仅在按下“保存到 PDF”按钮后运行 2)名称字段的值(存储在变量“NameString”中)应添加到生成的 pdf文件。

目前,如果我运行脚本(data2.py),它会同时创建 Frame 和 pdf 文件(不包括“NameString”)。这不是我想要的,我希望只有在单击/按下“保存到 PDF”按钮后才能打开 pdf 并包含“NameString”。

在此先感谢您的时间。

数据1.py

数据2.py