パスの長さに応じてウインドウの横幅を変えたいのだけど変わってくれない。
activeMessageLoopを使ってるからダメっぽいが、他にやり方が分からない。
なお、親ディレクトリのパスを取得する処理は、UNCパスにも対応させたかったので、os.pathは使わずに地味な文字列処理で実装。
あと、StepIntoの方は、CraftLaunch3標準の補完機能に任せることとして、実装を諦めた。
ソース
Pythonは素人なので、書き方がなってないかもしれない。1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | import os import sys from clnch import * # 設定処理 def configure(window): (snip) # stepOutto def command_stepOutto(info): parentPath = info.args[ len (info.args) - 1 ] ps = "/" if ckit.ckit_misc.pathSlash() else "\\" if parentPath[ len (parentPath) - 1 :] = = ps: parentPath = parentPath[: len (parentPath) - 2 ] indexOfSlash = parentPath.rfind(ps) if indexOfSlash ! = - 1 : parentPath = parentPath[:parentPath.rfind(ps) + 1 ] text = "" if len (info.args) > = 2 : for i in info.args[: len (info.args) - 1 ]: text + = i + ";" text + = parentPath window.activeMessageLoop (text) window.cmd_keymap[ "C-Left" ] = command_stepOutto (snip) |
CraftLaunch3のファイラ連携
今のところ、ファイラ(あふw)から<clnchのパス>\clnch.exe --position="(40,40)" --text="AfxwPathChg;$P" |
呼び出した時のウインドウの横幅が変えられないので、呼び出し後に文字が隠れて全然見えない。
横幅を変えるにはwindow.setPosSizeを使えばいいと思うのだけど、この関数にはウインドウの位置(座標)も渡さなくてはいけない。で、現在のウインドウ位置の取得方法が分からない。
幅と高さはwindow.width()とwindow.height()で取れるのだけど。。。
ゆるぼ:有識者のアドバイス
0 コメント:
コメントを投稿