wxPython 实现右下角弹出框
来源:互联网 发布:rmvb编辑软件绿色版 编辑:程序博客网 时间:2024/05/22 00:20
转载注明出处
http://blog.csdn.net/xugangjava/article/details/7478139
使用windows api
workarea = win32api.GetMonitorInfo(1)['Work']
pos=(workarea[2]-280,workarea[3]-180)
这两句 来得到 屏幕右下角的坐标
AnimateWindow来执行 弹出动作
下面是源代码
# -*- coding: gbk -*-#!/bin/env python# Author: 许刚# Created: 2012/1/1import wx,os,win32apifrom res import *from common import RoleStr,GetIconByFileExt,FileExtfrom win32con import AW_ACTIVATE, AW_BLEND, AW_CENTER, AW_HIDE, AW_HOR_NEGATIVE, \ AW_HOR_POSITIVE, AW_SLIDE, AW_VER_NEGATIVE, AW_VER_POSITIVE,SPI_GETWORKAREAimport win32apifrom ctypes import windll, c_int########################################################################class Popup(wx.MiniFrame):def __init__(self, label, parent=None,title=""):wx.MiniFrame.__init__(self, parent, -1, title, wx.DefaultPosition,size=(280,180),style=wx.DEFAULT_FRAME_STYLE| wx.STAY_ON_TOP)workarea = win32api.GetMonitorInfo(1)['Work']pos=(workarea[2]-280,workarea[3]-180)bg=wx.Colour(255, 255, 225)self.SetBackgroundColour(bg)self.SetPosition(pos)text = wx.StaticText(self, -1, label)#font = wx.Font(13, wx.FONTENCODING_SYSTEM, wx.NORMAL, wx.NORMAL)#text.SetFont(font)text.SetBackgroundColour(bg)flags = AW_SLIDE | AW_VER_NEGATIVE | AW_ACTIVATEwindll.user32.AnimateWindow(c_int(self.GetHandle()), c_int(600), c_int(flags))self.Refresh()self.Bind(wx.EVT_CLOSE,self.RemovePopup)def RemovePopup(self, evt=None):flags = AW_BLEND | AW_HIDEwindll.user32.AnimateWindow(c_int(self.GetHandle()), c_int(600), c_int(flags))self.Destroy()########################################################################if __name__=='__main__':app=wx.PySimpleApp()f=Popup('测试右下角弹出框\n测试右下角弹出框\n\n')f.Show()app.MainLoop()
最后运行效果
- wxPython 实现右下角弹出框
- 右下角弹出框实现
- jquery 实现仿QQ右下角弹出框
- jQuery实现在右下角弹出提示框
- EasyUI实现页面右下角弹出提示框
- 右下角弹出框
- 右下角弹出框(2)
- 右下角弹出框(3)
- 右下角弹出框(4)
- 关于右下角弹出框
- 右下角弹出框
- jquery 右下角弹出框
- 右下角的弹出框
- 运用AJAX实现右下角弹出提示框 示例
- javascript实现屏幕右下角弹出信息提示框
- 使用jQuery的message插件实现右下角弹出消息框
- 使用jQuery的message插件实现右下角弹出消息框
- 使用jQuery的message插件实现右下角弹出消息框
- 接口和继承
- thunderbird设置
- Service(二)
- C++多态原理
- android---APN切换
- wxPython 实现右下角弹出框
- 分析学习【1】—— Anti-debug分析及Snapshot学习
- 数字图像交换格式(Digital Picture Exchange)简称DPX
- Android MediaPlayer类详解
- poj 百练 2819(基础题)
- android NDK程序
- 利用堆栈解析算术表达式
- C语言:深复制VS浅复制 数组VS指针
- 激活mac对话框中 tab 键蓝色按钮切换