- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用 wxPython 搜索特定目录中的所有文件。当它搜索文件时,进度(文件数)被发送到进度条,只是为了提供一些背景信息。我想要做的是将进度条向下移动到 SetStatusText 通常显示名称的框架底部。但是,当开始搜索时,我希望名称/文本被进度条替换。目前,当我尝试更改进度条的位置时,它只能在进度条的正上方可见。
其次,我想将图形用户界面锁定在当前大小,这样窗口就不能调整大小了。我看了几个例子,但每个例子都以某个默认大小开始。我希望我的 gui 保持我给它的大小,因为按钮的显示方式保证了它。以下是 gui 代码的样子:
class MyApp(wx.App):
def OnInit(self):
frame = MainWindow("ST v2.0.0", (50, 60), (458, 332))
frame.Show()
self.SetTopWindow(frame)
return True
class MainWindow(wx.Frame):
def __init__(self, pos, size, title):
wx.Frame.__init__(self, None, -1, pos, size, title)
panel = wx.Panel(self, wx.ID_ANY)
panel.SetBackgroundColour('LIGHT GREY')
toolbar = self.CreateToolBar()
toolbar.Realize()
menuFile = wx.Menu()
menuFile.Append(1, "&About...")
menuFile.AppendSeparator()
menuFile.Append(2, "E&xit")
menuBar = wx.MenuBar()
menuBar.Append(menuFile, "&File")
menu2 = wx.Menu()
menu2.Append(wx.NewId(), "&Copy", "Copy in status bar")
menu2.AppendSeparator()
menu2.Append(wx.NewId(), "C&ut", "")
menu2.AppendSeparator()
menu2.Append(wx.NewId(), "Paste", "")
menu2.AppendSeparator()
menu2.Append(wx.NewId(), "&Options...", "Display Options")
menuBar.Append(menu2, "&Edit")
self.SetMenuBar(menuBar)
self.CreateStatusBar()
self.SetStatusText("Welcome to sQAST!")#can put connected here when logged in
self.Bind(wx.EVT_MENU, self.OnAbout, id=1)
self.Bind(wx.EVT_MENU, self.OnQuit, id=2)
x = 100
#Progress Gauge
self.gauge = wx.Gauge(panel, -1, x ,pos=(180, 0), size=(-1, 20))
#Close button
self.button = wx.Button(panel, label="EXIT", pos=(229, 160), size=(229, 80))
self.Bind(wx.EVT_BUTTON, self.OnQuit, self.button)
self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
#Dispenser button
self.button2 = wx.Button(panel, label="Serv 1", pos=(0, 160), size=(229, 80))
self.Bind(wx.EVT_BUTTON, self.OnStartButton, self.button2)
#Site Server
self.button3 = wx.Button(panel, label="SERV 2", pos=(0, 80), size=(229, 80))
self.Bind(wx.EVT_BUTTON, self.OnSiteservButton, self.button3)
#Local Search
self.button4 = wx.Button(panel, label="ABORT", pos=(229, 80), size=(229, 80))
self.Bind(wx.EVT_BUTTON, self.OnAbortButton, self.button4)
self.button4.Disable()
self.shouldAbort = False
这对我有用:
count = 0
count2 = 0
for afile in filelist:
(head, filename) = os.path.split(afile)
if afile.endswith(".log") or afile.endswith(".txt"):
count2 += 1
self.progress_bar.Show()
wx.CallAfter(self.progress_bar.SetValue, count2)# This works ....
f=ftp.open(afile, 'r')
for i, line in enumerate(f.readlines()):
result = regex.search(line)
if self.shouldAbort:
return self.shouldAbort
break
最佳答案
有几种不同的方法可以做到这一点。我认为最简单的方法就是使用 EnhancedStatusBar 小部件:http://wiki.wxpython.org/EnhancedStatusBar
但是,此线程还提到了一种使用普通 StatusBar 的方法:http://wxpython-users.1045709.n5.nabble.com/Add-a-progressbar-in-a-statusbar-td2365269.html
至于使 Frame 的大小“固定”,请尝试将其 SetSizeHints 设置为您想要的大小。
关于python - 如何在状态栏区域放一个进度条(gauge)并锁定gui大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7919564/
是否有可能像 dojox.gauges 那样在更新时指针逐渐改变值你可以在这个example中看到, 当你按下按钮 set 15 直接变成了15。 是否有可能让它逐渐通过中间值? 最佳答案 根据 do
我正在尝试使用 Highcharts (实心表)创建自定义数据刻度盘。 请帮帮我。 我无法生成像实心仪表尖刻度盘那样的箭头端。这是我当前的图表: 更新代码:请复制粘贴下面提供的 fiddle 链接中的
我有一个自 2019 年 1 月以来一直在使用的仪表项目,突然我开始收到此不受支持的仪表版本错误。我认为这是由于 Gauge、intellij 或 gauge intellij 插件的更新造成的,但事
我正在尝试实现 http://bernii.github.com/gauge.js/使用 gauge.min.js 而不是咖啡。但对于我的一生来说,我什至无法展示这一点。谁能给我代码来让它显示出来吗?
我正在使用 melonJS 制作 2d 游戏。 在我的游戏中,我有一个绕其轴旋转的箭头。这个箭头是一个png图像。当我保持鼠标左键时,箭头需要从黄色填充到红色,从底部到顶部。这是一个例子: 初始箭头全
当 max 设置为非常大的数字(例如 666772)时会出现问题。Highcharts 将根据 tickPixelInterval 设置的内容取该数字并将其向下舍入。 如果我将 tickPixelIn
我正在尝试更改谷歌仪表轴的数字格式。默认情况下,轴值是一个整数(例如 0、120),但我想显示一个 £ 符号和格式为货币(例如 £0、£120)。我已经能够使用 NumberFormat 更改仪表底部
使用 Gauge我们可以使用 Context Steps 在每个场景之前重复一组步骤紧跟在测试规范标题之后。例如: Delete project ============== * User log i
我尝试在 Gauge 规范中使用 file 特殊参数。 Export a customer ---------------------------------------- * Find custom
我试图设置由 google chart api 创建的 gauge gauge 的字体大小 我对如何使用 css 来改变 gauge 的字体大小有点困惑 html代码 我使用以下几行
我有一个范围从 0 - 100 的交互式 dojox 仪表。但我只希望我的用户能够将指针移动到 0、25、50、75 和 100。这可能吗? // create the
我目前刚刚开始使用 JS,需要一个项目的 highcharts,到目前为止一切顺利,但我确实有一个非常新手的问题:我有一些任务执行 cron 作业并将值范围:10-90 输出到文件。如何将值加载到仪表
我正在开发一个显示来自服务器的实时数据的页面。现在我正在用一些 mqtt 客户端 websocket(比如 hivemq)测试它。我收到的值本身显示在 chrome 控制台中,但我正在尝试使用 NGX
在仪表图中,使用 jquery 插件。 此时,我正在设置固定值,但我需要通过 json 存档设置值和颜色。我该如何制作? $('.gauge1').gauge
我正在使用 wxPython 搜索特定目录中的所有文件。当它搜索文件时,进度(文件数)被发送到进度条,只是为了提供一些背景信息。我想要做的是将进度条向下移动到 SetStatusText 通常显示名称
我使用的是具有十进制值的 highcharts 实心仪表。这是 jsfiddle http://jsfiddle.net/7hm1mkbn/ $('#container-temp').highchar
我有一个要发送到 prometheus 的 json 格式的指标列表。我如何使用 client_golang 中的 Guage 指标类型将这些指标一次全部发送到 prometheus? 现在我有下面的
上下文:我想为 RabbitMQ 构建自己的导出器。为此,我设置了一个 HTTP 服务器来查询管理 API,解析响应并使用 Prometheus 格式构建适当的响应 我正在测量队列中的消息数量,以便在
我是 android 新手,一直在学习 udacity android 类(class)。我被要求从 github 安装一个现有的 android 项目,所以我收到以下错误。 无法启动 Gauge I
我已经尝试并走到了这一步,但仍然无法按照要求实现。 var chart = new Highcharts.chart('container', { chart:{ ty
我是一名优秀的程序员,十分优秀!