Python/wxPython/wx.TextCtrl: Difference between revisions

From Fundamental Ramen
Jump to navigation Jump to search
Line 3: Line 3:
=== Python ===
=== Python ===
<source lang="python">
<source lang="python">
im = wx.Image(image_stream)
self.wxtc = wx.xrc.XRCCTRL(self.frame, 'name_of_wxtc', 'wxTextCtrl')
bm = wx.Bitmap(im)
self.wxtc.Bind(wx.EVT_KEY_UP, self.OnKeyPress, id=wx.xrc.XRCID('name_of_wxtc'))
sb = wx.xrc.XRCCTRL(self.frame, 'name_of_wxsb', 'wxStaticBitmap')
sb.SetBitmap(bm)
</source>
</source>



Revision as of 09:57, 4 December 2019

XRC Example

Python

self.wxtc = wx.xrc.XRCCTRL(self.frame, 'name_of_wxtc', 'wxTextCtrl')
self.wxtc.Bind(wx.EVT_KEY_UP, self.OnKeyPress, id=wx.xrc.XRCID('name_of_wxtc'))

XRC

<object name="name_of_wxtc" class="wxTextCtrl">
  <size>200,25</size>
</object>

Programmatically Example

# TODO

Documents