简体   繁体   English

在pyGTK中编写配置文件的最佳信号是什么?

[英]What is best signal for writing configuration file in pyGTK?

I want to save window position and size when user is closing main window of my application, but i cant get correct window position 当用户关闭我的应用程序的主窗口时,我想保存窗口位置和大小,但我无法获得正确的窗口位置

myTopLevelWindow.connect('unrealize', self.__onUnrealize)

def __onUnrealize(self, widget):
    myTopLevelWindow.get_size() #OK
    myTopLevelWindow.get_position()    <-- always (0, 0) :P

in what signal handler get_position() will work correctly? 在什么信号处理程序get_position()将正常工作? I've tried 'destroy' and it's also not good :/ 我试过'破坏'而且它也不好:/

Have you tried "delete-event"? 你试过“删除事件”吗? I just tested it in C and gtk gives me the correct position/size in the handler. 我只是在C中测试它,并且gtk在处理程序中给出了正确的位置/大小。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Glade还是没有林间空地:使用PyGtk的最佳方式是什么? - Glade or no glade: What is the best way to use PyGtk? 在 PyGTK 中,显示 PNG 文件的简单方法是什么? - In PyGTK, what is a simple way to show a PNG file? 用pyGTK移动6个不同的蓝色小球的最佳解决方案是什么? - What is the best solution to move the 6 different blue balls with pyGTK? 在将解析的XML写入文件之前,最好的存储方法是什么? - What's the best way to store parsed XML before writing it to a file? 在多个文件的文件中写入一个单词的出现次数并将结果写入另一个文件的最佳方法是什么 - What is the best way of writing the number of occurrences of a word in a file for multiple files and writing the results to another file 如何在 pygtk 中创建新信号 - How do I create a new signal in pygtk 在编写配置文件时,使用ConfigParser而不是常规python.py文件有什么好处? - What is the benefit of using the ConfigParser instead of a regular python.py file when writing configuration files? PyGTK Glade文件管理器 - PyGTK Glade File Manager PyGTK + Glade:没有任何信号的按钮触发另一个信号 - PyGTK + Glade: button without any signal triggers another signal 为了节省空间,哪种字符编码最适合写入 Python 中的文件,仅用于位和换行符 (0, 1, '\n')? - What character encoding is best for writing to a file in Python for only bits and newline (0, 1, '\n'), for space-conserving purposes?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM