Skip to content

Commit 646e01e

Browse files
committed
Just test.
1 parent 6b60126 commit 646e01e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/python/demo/Test.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
'''
2+
Created on 2013-7-12
3+
4+
@author: SuShiting
5+
'''
6+
import win32gui,win32con
7+
import vim
8+
9+
def setWindowTransp():
10+
hwnd=win32gui.FindWindow("Vim",None)
11+
if hwnd:
12+
s=win32gui.GetWindowLong(hwnd,win32con.GWL_EXSTYLE)
13+
win32gui.SetWindowLong(hwnd, win32con.GWL_EXSTYLE, s|win32con.WS_EX_LAYERED)
14+
opCode=vim.eval("g:alphaOp")
15+
alphaValue=int(vim.eval("g:alphaValue"))
16+
stepValue=int(vim.eval("g:stepValue"))
17+
18+
if opCode=="plus":
19+
alphaValue=alphaValue+stepValue
20+
else:
21+
alphaValue=alphaValue-stepValue
22+
23+
if alphaValue<200 or alphaValue>255:
24+
vim.command("echo 'AlphaValue exceed!'")
25+
else:
26+
vim.command("let g:alphaValue="+str(alphaValue))
27+
win32gui.SetLayeredWindowAttributes(hwnd, 0, alphaValue,win32con.LWA_ALPHA)
28+
29+
setWindowTransp()
30+
31+

0 commit comments

Comments
 (0)