wxwidgets

C++ Event (Focus) Handling

Due to comments I added the following code (in BasicPanel) Connect(CTRL_ONE, wxEVT_KILL_FOCUS, (wxObjectEventFunction)&BasicPanel::OnKillFocus); Connect(CTRL_TWO,wxEVT_KILL_FOCUS, (wxObjectEventFunction)&BasicPanel::OnKillFocus); Connect(CTRL_THREE, wxEVT_KILL_FOCUS, (wxObjectEventFunction)&BasicPanel::OnKillFocus); Connect(CTRL_FOUR, ...

WxWidgets custom events

Hello, I'm trying to use a custom event in my WxWidgets C++ application, like described here. In the constructor of my wxApp: Connect(wxID_ANY, wxCommandEventHandler(APP::OnMyEvent)); Then the function that should catch the event: void APP::OnMyEvent(wxCommandEvent& event) { exit(0); //testing } Finally, to test it: wxComman...

How to change the current selection in a wxListbook from another thread?

How can I change the current selection in a wxListbook from another thread? When I pass the listbook's pointer to the thread and try to change the selection, the app crashes. What is a safe way of doing this? Is there some message I can send to it? ...

Get text when enter is pressed in a text box in wxPython

I have a (single line) TextCtrl. The user types data into this. When they press enter, the contents of the box need to be extracted so they can be processed. I can't figure out how to catch enter being pressed. According to the docs, with the style wx.TE_PROCESS_ENTER set on my TextCtrl, it should generate a wx.EVT_COMMAND_TEXT_ENTER ev...

Question regarding inheritance in wxWidgets.

Currently I'm attempting to write my own wxObject, and I would like for the class to be based off of the wxTextCtrl class. Currently this is what I have: class CommandTextCtrl : public wxTextCtrl { public: void OnKey(wxKeyEvent& event); private: DECLARE_EVENT_TABLE() }; Then later on I have this line of code, ...

compile wxWidget on Snow Leopard

I just downloaded wxWidget source code on my snow leopard machine. The source code is the multiplatform one, so it contains windows and GTK components of wxWidget as well. I'd like to compile the wxWidget source code, but haven't found a good guide yet. This is my first step to create a multiplatform project, hopefully I would be able t...

Getting a RichTextCtrl's default font size in wxPython

I have a RichTextCtrl, which I've modified to accept HTML input. The HTML parsing code needs to be able to increase and decrease the font size as it gets tags like <font size="-1">, but I can't work out how to get the control's default font size to adjust. I tried the following (where self is my RichTextCtrl): fred = wx.richtext.RichTex...

wx.ListCtrl and column header tooltips

Hi everyone! I'm looking for a way to show tooltips whenever the user hovers the mouse on a column header of a wx.ListCtrl, is this possible? I tried binding wx.EVT_MOTION but it looks like it works only for the list items, not the headers.. Am I doing something wrong? Thanks in advance! (wxPython 2.8.9.1 on Xubuntu 9.04) ...

Horizontal scrolling in a wx.RichTextCtrl

I have a RichTextCtrl created as follows: self.userlist = wx.richtext.RichTextCtrl(self, style=wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL) It all works fine, except for the wx.HSCROLL style. If I change the RichTextCtrl to a regular TextCtrl, it correctly horizontal scrolls on long lines, rather than wrapping, but on the RichTextCtrl i...

Does using wxWidgets only for easier Win32 Programming make sense?

I'm writing a GUI Applikation which needs to use native Windows Controls. I'm also using a very exotic programming language with an otherwise complete runtime library. This means i have to write a GUI toolkit language binding anyway. Without the benefits of being cross platform, C++ and having a lot of other non GUI stuff is it worth u...

wxWidgets exception handling

When unhandled exception is handled in wxWidgets application in Windows, program shows Abort-Retry-Ignore message produced by Widgets exception handler. I want to get normal unhandled exception behavior: program should terminate with standard Windows unhandled exception dialog. Can I prevent Widgets to catch unhanled exceptions? ...

Is there a wxPython equivalent of datetime.combine?

The python datetime.datetime object has the combine method. Is there an equivalent for wx.DateTime objects? ...

wxWidgets: Get some unique machine ID to use in validation/registration

Does wx provide a handy way to get anything like this in a platform-independent way? I don't think C++ libs themselves provide anything. I don't have a definite idea what should be used for the unique ID... MAC address is common but what else could be used? If we were doing it Windows-specific, is there a way to get the actual Windows ...

Reset selection of wx.lib.calendar.Calendar control?

I have a wx.lib.calendar.Calendar control (not wx.lib.calendar.CalendarCtrl!). I am selecting a number of days using the following function call: self.cal.AddSelect([days], 'green', 'white') This works, and draws the days highlighted. However, I cannot work out how to reverse this (i.e., clear the selection so the days go back to thei...

How can I fix the scroll bug when using Windows rich edit controls in wxpython?

When using wx.TextCtl with the wx.TE_RICH2 option in windows, I get this strange bug with the auto-scroll when using the AppendText function. It scrolls so that all the text is above the visible area, which isn't very useful behaviour. I tried just adding a call to ScrollLines(-1) after appending the text - which does scroll it to the c...

Why can't I pass an argument to create this window using wxpython?

I am trying to learn how to make a GUI in python! Following an online tutorial, I found that the following code 'works' in creating an empty window: import wx from sys import argv class bucky(wx.Frame): def __init__(self, parent, id): wx.Frame.__init__(self, parent, id, 'Frame aka window', size=(300, 200)) if __name__=='__...

How to make floating frames with wx.aui.AuiManager be proper windows

Hello all I'm using wxPython. I'm trying to figure out how I can change the behavior of the wx.aui.AuiManager so that when a window is dragged to become floating, it will become a proper window with Minimize and Maximize buttons and shown in the Taskbar. Apparently there is some subclassing done of the standard window to remove those...

Display static image in wxWidgets?

Hello there, It's been days for me trying to display a BMP image from memory in a wxWidgets dialog, but none of my tries succeed. First, I tried to create a wxStaticBitmap control in my dialog: // in class declaration inside header file wxStaticBitmap *ibitmap; // in wxDialog constructor // MyLogo is an array of `unsigned char` // ...

wxWidgets wxBitmap

Hello, Im trying to create toolBar. I added resource file to the Visual Studio project, then added to that resource png file. Now the question is how to use it as a icon for the button? this is my code: wxBitmap exit(wxT("cross.png")); and when I run application I have error: Cant load "cross.png" bitmap from resource. Please check ...

wxWidgets vs QT

Just like in the tile? If You have any experience with both frameworks give me an advice which one use and why (C++ programming) thanks for help ...