wxPythonの基本となるFrameのサンプルです。まずはFrameを生成し、そのFrame上に様々なものを配置していくのが主な流れとなります。 フレームの生成 まずは下記サンプルを実行してみましょう。 import wx application = wx.App() frame = wx.Frame(None, wx.ID_ANY, 'テストフレーム') frame.Show() application.MainLoop() テストフレームというタイトルの何もないフレームが表示されたはずです。 では一つずつ何をしているのか見ていきましょう。 import wx application = wx.App() frame = wx.Frame(None, wx.ID_ANY, 'テストフレーム') frame.Show() application.MainLoop() まずは3行目、この記
Introduction Drag and drop support within wxPython is a conversation between a "drop source" and a "drop target". The conversation is accomplished by sharing a "data object" which includes certain pieces of metadata (primarily the data types available from the drop source) as well as the actual shared data. What Objects are Involved Source window -- Interprets an event as the beginning of a new dr
アプリケーションを立ち上げて、その画面にファイルをドラッグ&ドロップすると、画面にそのファイル名が表示されるような仕組みを、wxPythonで実装したい。 そのためには、wx.FileDropTargetクラスを使えばよい。例えば、下記のコードのように書ける。 import wx class MyFileDropTarget(wx.FileDropTarget): def __init__(self, window): wx.FileDropTarget.__init__(self) self.window = window #ファイルをドロップする対象 def OnDropFiles(self, x, y, filenames): #ファイルをドロップするときの処理 for file in filenames: self.window.text.SetValue(file) clas
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く