wxpython

wx.StaticText's label does not contract using SetSizerAndFit()

wx.StaticText's label does not contract using SetSizerAndFit() Question: I’d like to place a filename after the file is chosen and contract it if the file name is too long. Here is my code: import wx class Dlg(wx.Dialog): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.input_pnl = wx.Panel(self) self.choose_input = wx.Button(self.input_pnl, label=’Select’) self.input_filename = wx.StaticText(self.input_pnl, style=wx.ST_ELLIPSIZE_END) self.input_szr …

Total answers: 1

Opening a window on top of other windows

Opening a window on top of other windows Question: How to open a window on top of other windows when calling a function? import wx def openFile(wildcard="*"): app = wx.App(None) style = wx.FD_OPEN | wx.FD_FILE_MUST_EXIST dialog = wx.FileDialog(None, ‘Open’, wildcard=wildcard, style=style) if dialog.ShowModal() == wx.ID_OK: path = dialog.GetPath() else: dialog.Destroy() path = ‘No file’ return …

Total answers: 2

wxPython StaticText in class not updating

wxPython StaticText in class not updating Question: I have a simple local network chat program with a chat log that is a wx.StaticText object and I’m having issues with it not updating when I set the label. I had it working previously with just self.chat_box.SetLabel(chatHistory_Display), but that was before I had to separate the elements …

Total answers: 1

WxPython, How to implement paging functionality for wx.grid.Grid?

WxPython, How to implement paging functionality for wx.grid.Grid? Question: I want to load a csv file with (10 cols, 1 000 000 rows), on to wx.Grid with row autosizing. The time taken to auto size 1 million rows is too much (>1 hour depending on data). So I want to implement paging functionality to wx.Grid. …

Total answers: 1

AddPrivateFont to App Title / Title bar in WxPython?

AddPrivateFont to App Title / Title bar in WxPython? Question: My problem is I can’t find the way to use AddPrivateFont to change the App Title font in WxPython. From the demo https://github.com/wxWidgets/Phoenix/blob/master/demo/AddPrivateFont.py and the sample https://wiki.wxpython.org/How%20to%20add%20a%20menu%20bar%20in%20the%20title%20bar%20%28Phoenix%29 I tried f = wx.Font( pointSize=18, family=wx.FONTFAMILY_DEFAULT, style=wx.FONTSTYLE_NORMAL, weight=wx.FONTWEIGHT_NORMAL, underline=False, faceName="Youth Touch", encoding=wx.FONTENCODING_DEFAULT, ) xwq = self.SetAppName("Custom Gui …

Total answers: 1

Updating Old wxPython App: Invalid Window Calling Super/Parent Method

Updating Old wxPython App: Invalid Window Calling Super/Parent Method Question: I am trying to update an old app that was written for Python 2.7 with wxWidgets/wxPython 2.8. I am trying to make it compatible with my current system’s versions of Python (3.10) & wxPython (4.0). I have come across an error trying to call a …

Total answers: 2

How do I detect if a wx.Menu has been destroyed

How do I detect if a wx.Menu has been destroyed Question: I’m porting an application from: Python 2.5.4 2.8.10.1 (msw-unicode) to: Python 3.7.9 4.1.1 msw (phoenix) wxWidgets 3.1.5. The following snippet gives different results. In particular it seems that previously you were able to detect if a wx.Menu had been deleted by just doing "if …

Total answers: 1

Pip cannot install wxPython for Python 3.10 (32-bit)

Pip cannot install wxPython for Python 3.10 (32-bit) Question: I have installed two frameworks of Python 3.10. There is wxPython310 for 64-bit Python. But there aren’t any wxPython for 32-bit Python. I tried to install wxPython with https://wxpython.org/Phoenix/snapshot-builds/wxPython-4.1.2a1.dev5259+d3bdb143.tar.gz, but it shows me the error code like this. Running setup.py install for wxPython … error error: …

Total answers: 4