草庐IT

withdraw

全部标签

ruby-on-rails - 摩卡 : How to add expectation of a method when there are multiple invocations with different parameters

我有一个RailsControllerAction要测试。在那个Action中,一个方法User.can?使用不同的参数多次调用。在其中一个测试用例中,我想确保User.can?('withdraw')被调用。但我不关心User.can的调用?与其他参数。defaction_to_be_tested...@user.can?('withdraw')...@user.can?('deposit')...end我在测试中尝试了以下:User.any_instance.expects(:can?).with('withdraw').at_least_once.returns(true)但是测

python - 如何显示使用 "withdraw"方法隐藏的窗口?

我想在调用withdraw后显示一个窗口。以下是我目前的代码:fromTkinterimport*defcallback():globalrootroot.withdraw()win2=Tk()root=Tk()Label(root,text='thisisawindow').pack()Button(root,text='withdraw',command=self.callback).pack()mainloop()我一按下按钮,窗口就如我所愿地消失了,然后又出现了另一个窗口,一切正常。如何让第一个窗口恢复到与之前相同的状态? 最佳答案

python - Python Tkinter 中 iconify() 和 withdraw() 的区别

就Tkinter的iconify()和withdraw()方法的区别而言,我一直在搜索但没有找到答案。iconify()似乎将窗口“转换”为任务栏图标并具有“图标”状态withdraw()似乎只是将窗口从屏幕上移除,之后窗口处于“withdrawn”状态如果您需要扭转这种情况,您只需在两种情况下都调用deiconify()。然而,这两种方法之间的真正区别是什么?它们之间有何本质区别?此外,它们适用于不同的情况吗? 最佳答案 你记对了。更详细:iconify()将窗口变成图标(不破坏它)。要重绘窗口,请使用deiconify。在Win