wxWidgets | Cross-Platform C++ GUI Library
kandi X-RAY | wxWidgets Summary
kandi X-RAY | wxWidgets Summary
wxWidgets is a free and open source cross-platform C++ framework for writing advanced GUI applications using native controls. wxWidgets allows you to write native-looking GUI applications for all the major desktop platforms and also helps with abstracting the differences in the non-GUI aspects between them. It is free for the use in both open source and commercial applications, comes with the full, easy to read and modify, source and extensive documentation and a collection of more than a hundred examples. You can learn more about wxWidgets at and read its documentation online at
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of wxWidgets
wxWidgets Key Features
wxWidgets Examples and Code Snippets
Community Discussions
Trending Discussions on wxWidgets
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.
ANSWER
Answered 2022-Apr-11 at 01:52Common problem with installing various versions is python interpreters that used for the installation
Make sure you use compatible version of python to install wxPython310 What IDE you use ?
for all case scenarios I would recommend to make sure that the installation done with the right Python version , if you don't know then reinstall required versions and make sure the versions you installed support the package
Tutorial for installing : Link
QUESTION
Right now I'm using wxWidgets msw 3.0.5 on Windows 7 and the xrc file was created with wxFormBuilder 3.10.1
Normally I use something like this to avoid my wxframe be resized smaller than my child controls:
...ANSWER
Answered 2022-Mar-29 at 12:36The names are unfortunately confusing, but SetSizerAndFit()
calls SetSizer()
and wxSizer::SetSizeHints()
, and not wxWindow::Fit()
as might be expected. So to have exactly the same behaviour as in the first case you need to call GetSizer()->SetSizeHints(this)
in your frame code.
And, FWIW, wxSizer::SetSizeHints()
does something sensibly equivalent to
QUESTION
I am capturing the mouse for GridColLabelWindow but getting an assertion message "!wxMouseCapture::IsInCaptureStack(this) failed. Recapturing the mouse in the same window?" for the following code:
...ANSWER
Answered 2022-Mar-29 at 12:32In general you're not supposed to interfere with the built-in mouse handling and the grid windows have their own, relatively complicated logic, dealing with the mouse capture, so it's not really surprising that doing what you do breaks it. I'm not sure what exactly are you trying to do, but try handling wxGrid higher level events to implement it, if possible (one problem here is that the resizing events are still not generated as of 3.1.6, but it would be nice to add them...).
QUESTION
"Toggle Sidebar" is the only item I have added, how do I remove the other items which I don't really need? I'm stuck
I'm on macOS 12.2 with wxWidgets v3.1.5
here's the code I used to add the menu:
...ANSWER
Answered 2022-Mar-18 at 04:37As said in the comments, calling SetMenuBar()
on the frame first and then appending the menus fixed the issue.
QUESTION
I'm just starting with wxWidgets and I've run into a problem.
I have a mainwindow and another class derived from wxDialog. The main window launches the dialog box in non-modal mode. When the dialog closes, it posts an event but the handler for this event never gets called.
I'm using wxWidgets 3.1.5
The above two classes share a common header file, in which I have this code
wxDECLARE_EVENT(EVT_VISOR, wxCommandEvent);
This is my event table
...ANSWER
Answered 2022-Mar-11 at 10:24I think you're nearly there. I think what you could do is pass the wxFrame
as a parent to your modeless dialog and post the event via the parent.
QUESTION
I'm using a wx.Listbook
, which uses a ListCtrl to select pages within the Listbook. However, the width of the ListCtrl is less than the shortest page name. I would like to increase the width so that the page names are not truncated, but can't seem to.
Of course, I can access the ListCtrl using Listbook.GetListView()
. However, changing the size has no effect. I also tried to access the sizer of the ListCtrl (via myListCtr.GetContainingSizer()
) but that returns None
.
How can I increase the width of the ListCtrl within a wx.Listbook?
...ANSWER
Answered 2022-Feb-26 at 09:32This seems to work. See my note on lb_width
QUESTION
I am getting an error while trying to cross-compile my application on ArchLinux
for Windows
using mingw
. I am using meson
for the build system and I wrote a .ini
file according to the documentation here. Here is the .ini
file,
ANSWER
Answered 2022-Feb-15 at 05:13It seems like the error was because of link time optimization.
MinGW
doesn't seem to like link time optimization, disabling it compiles wx
just fine. I found the related information from here.
QUESTION
- wxWidgets: 3.1.5 (also tried the latest source from github)
- wxWidgets: built using gcc-11.2 under msys2 (ucrt64)
- Windows 10 Application: build using gcc-11.2 under msys2 (ucrt64)
- Monitor native resoultion: 3840 x 2160
- IDE: Eclipse 2021-09
If I build my application and link against a resource file that is not using a HiDPI aware manifest then everything works correctly but the fonts are, as one would expect, pixelated. However, once I link with a HiDPI aware resource file then the controls are not resized proportionally with their associated text. Please see the following screenshots.
The image above shows the test wxFrame being rendered without a HiDPI aware resource file. The monitor scaling was 200%. As you can see, the wxFrame has rendered correctly.
The image above shows the test wxFrame being rendered without a HiDPI aware resource file. The monitor scaling was 350%. As you can see, (aside from the blurry text) the wxFrame has rendered correctly..
The image above shows the test wxFrame being rendered with a HiDPI aware resource file. The monitor scaling was 200%. As you can see, the wxFrame has rendered badly. This wxFrame renders correctly at 100% scale.
Here is a minimal fully functional code sample to demonstrate my problem.
...ANSWER
Answered 2022-Feb-03 at 00:25It's a pretty bad idea to use sizes in pixels in general, as this doesn't take the current font size into account, and so using dialog units or just the result of GetTextExtent("something") would be better.
But if you absolutely want to use pixels, you need to at least convert them to the proper units using FromDIP()
, see HiDPI overview in the manual for more information.
And if you use
QUESTION
The requirements:
- 100k lines
- One of the columns is not text - its custom painted with wxDC*.
- The items addition is coming from another thread using wxThreadEvent.
- Up until now I used wxDataViewListCtrl, but it takes too long to
AppendItem
100 thousand time. - wxListCtrl (in virtual mode) does not have the ability to use wxDC* - please correct me if I am wrong.
The only thing I can think of is using wxDataViewCtrl + wxDataViewModel. But I can't understand how to add items.
I looked at the samples (https://github.com/wxWidgets/wxWidgets/tree/WX_3_0_BRANCH/samples/dataview), too complex for me. I cant understand them.
I looked at the wiki (https://wiki.wxwidgets.org/WxDataViewCtrl), also too complex for me.
Can somebody please provide a very simple example of a wxDataViewCtrl + wxDataViewModel with one string column and one wxDC* column.
Thanks in advance.
P.S.
Per @HajoKirchhoff's request in the comments, I am posting some code:
...ANSWER
Answered 2022-Jan-31 at 09:51Appending 100k items to a control will always be slow. That's because it requires moving 100k items from your storage to the controls storage. A much better way for this amount of data is to have a "virtual" list control or wxGrid. In both cases the data is not actually transferred to the control. Instead when painting occurs, a callback function will transfer only the data required to paint. So for a 100k list you will only have "activity" for the 20-30 lines that are visible.
With wxListCtrl
see https://docs.wxwidgets.org/3.0/classwx_list_ctrl.html, specify the wxLC_VIRTUAL
flag, call SetItemCount and then provide/override
- OnGetItemText
- OnGetItemImage
- OnGetItemColumnImage
Downside: You can only draw items contained in a wxImageList, since the OnGetItemImage return indizes into the list. So you cannot draw arbitrary items using a wxDC. Since the human eye will be overwhelmed with 100k different images anyway, this is usually acceptable. You may have to provide 20/30 different images beforehand, but you'll have a fast, flexible list.
That said, it is possible to override the OnPaint function and use that wxDC to draw anything in the list. But that'll get difficult pretty soon.
So an alternative would be to use wxGrid
, create a wxGridTableBase
derived class that acts as a bridge between the grid and your actual 100k data and create wxGridCellRenderer
derived classes to render the actual data onscreen. The wxGridCellRenderer
class will get a wxDC
. This will give you more flexibility but is also much more complex than using a virtual wxListCtrl.
QUESTION
c2: (x-0.5)^2+y^2=1;
solve(c2,y);
cs2: map(rhs, %);
at(cs2,[x=0.5]);
...ANSWER
Answered 2022-Jan-31 at 20:27I can't reproduce the behavior you're seeing. I compiled Maxima 5.43.2 (version number slightly mixed up in build_info
output below) and I don't get the results you're seeing. Here's what I see with the command line interface (I get the same result with wxMaxima).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install wxWidgets
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page