Search found 59 matches

by rudolfninja
Mon Apr 01, 2019 1:09 pm
Forum: C++ Development
Topic: wxImage from Xlib icon property
Replies: 7
Views: 148

Re: wxImage from Xlib icon property

I've found what was the reason. As it is said in the xlib specification: This is an array of 32bit packed CARDINAL ARGB with high byte being A, low byte being B So the image data format is BGRA, but not ARGB, thus using: unsigned char a = argb[3]; unsigned char r = argb[2] * a / 255; unsigned char g...
by rudolfninja
Mon Apr 01, 2019 12:45 pm
Forum: C++ Development
Topic: wxImage from Xlib icon property
Replies: 7
Views: 148

Re: wxImage from Xlib icon property

The "stupid" approach with wxImage didn't help:
icos_image.PNG
icos_image.PNG (13.89 KiB) Viewed 114 times
I tried to save the result of ARGBtoBitmap to the file, and the icons didn't look like they should. I'd bet that image data I get from Xlib function is incorrect, however Qt-based icons looks correctly.
by rudolfninja
Mon Apr 01, 2019 12:10 pm
Forum: C++ Development
Topic: wxImage from Xlib icon property
Replies: 7
Views: 148

Re: wxImage from Xlib icon property

I have no knowledge of Xlib neither do I know what class is PixelData (it is not wxPixelData) and how can it access wxBitmap. I didn't paste the definition of PixelData, but it is the same as in this post : typedef wxAlphaPixelData PixelData; But, are you sure the RGB values are premultiplied, i.e....
by rudolfninja
Mon Apr 01, 2019 11:52 am
Forum: C++ Development
Topic: wxImage from Xlib icon property
Replies: 7
Views: 148

Re: wxImage from Xlib icon property

I found this answer on the similar question. And modify my code to use RGBAtoBitmap function in my code with small modification of the RGBAtoBitmap (my version is ARGBToBitmap, not RGBA): wxBitmap* ARGBtoBitmap(unsigned char *rgba, int w, int h) { wxBitmap *bitmap=new wxBitmap(w, h, 32); if(!bitmap-...
by rudolfninja
Mon Apr 01, 2019 8:22 am
Forum: C++ Development
Topic: wxImage from Xlib icon property
Replies: 7
Views: 148

wxImage from Xlib icon property

Hi all, I'm trying to save application's icon into wxImage (or wxIcon - doesn't matter). According to Xlib properties documentation _NET_WM_ICON returns array of 32bit packed CARDINAL ARGB with high byte being A, low byte being B , so firstly I need to convert bytes to RGBA order. Here is my code: v...
by rudolfninja
Fri Mar 29, 2019 6:08 am
Forum: C++ Development
Topic: Scale or resize wxIcon
Replies: 5
Views: 102

Re: Scale or resize wxIcon

doublemax, I understood that you'd like to see the code to help me, however I wasn't able to show you the code yesterday.
PB, thanks. The problem was exact as you described: I use Scale instead of Rescale.
by rudolfninja
Thu Mar 28, 2019 4:32 pm
Forum: C++ Development
Topic: Scale or resize wxIcon
Replies: 5
Views: 102

Re: Scale or resize wxIcon

I want to resize icons from big sizes to small, so I hope it will not affect the quality of the icon.
The problem that I retrieve these icons from the Linux running applications. And some of them have different sizes
by rudolfninja
Thu Mar 28, 2019 4:20 pm
Forum: C++ Development
Topic: Scale or resize wxIcon
Replies: 5
Views: 102

Scale or resize wxIcon

Hi all, The problem: I have an array of wxIcons. The sizes of the icons might differ. I need to add these icons to wxImageList. Due to it is prohibited to insert images that are larger than wxImageList size (at least on Ubuntu), I decided to find the smallest wxIcon from my array, use it's size as a...
by rudolfninja
Mon Jan 28, 2019 9:07 am
Forum: Platform Related Issues
Topic: Segfault on Ubuntu 16.04 x86
Replies: 6
Views: 164

Re: Segfault on Ubuntu 16.04 x86

Looks like my wxWigets library was build in incorrect way. I rebuilt wxWidgets as described here and now everything is OK. But I now the question is how to use 3rd party libs for jpeg and png libs? As I understand I just need to specify them in ./configure --with-libpng=/path/to/libpng.so --with-lib...
by rudolfninja
Fri Jan 25, 2019 1:59 pm
Forum: Platform Related Issues
Topic: Segfault on Ubuntu 16.04 x86
Replies: 6
Views: 164

Re: Segfault on Ubuntu 16.04 x86

Actually no. I tested 18.04 x64 and 16.04 x86. I'll test it on 18.04 x86 and update the topic with results. gdb backtrace shows (gdb) bt #0 0xb74dda92 in g_type_check_instance_cast () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 #1 0x0868d309 in ?? () #2 0x206fffff in ?? () #3 0x098d6318 in ?? (...
by rudolfninja
Fri Jan 25, 2019 10:43 am
Forum: Platform Related Issues
Topic: Segfault on Ubuntu 16.04 x86
Replies: 6
Views: 164

Segfault on Ubuntu 16.04 x86

Hi guys, trying to run my project on ubuntu 16.04 x86 and see strange segmentation fault. I don't know the reason, but according to valgrind's output the problem comes from wxWidgets: Process terminating with default action of signal 11 (SIGSEGV): dumping core ==7729== Access not within mapped regio...
by rudolfninja
Wed Dec 12, 2018 11:24 am
Forum: C++ Development
Topic: wxDialog.ShowModal vs wxMessageDialog.ShowModal
Replies: 9
Views: 534

Re: wxDialog.ShowModal vs wxMessageDialog.ShowModal

Thanks to doublemax it was possible to find the solution.
The solution here was to override DoEnable method inside of custom button:

Code: Select all

void wxCustomButton::DoEnable(bool flag)
{
    Refresh();
    wxControl::DoEnable(flag);
}
by rudolfninja
Tue Dec 11, 2018 2:43 pm
Forum: C++ Development
Topic: wxDialog.ShowModal vs wxMessageDialog.ShowModal
Replies: 9
Views: 534

Re: wxDialog.ShowModal vs wxMessageDialog.ShowModal

Does the message box cover the button? If yes, there should be a paint event, otherwise it wouldn't be redrawn. No, message box doesn't cover the button. Check if any button method gets called when the message box closes. bool wxCustomButton::Enable(bool enable /* = true */) method isn't called whe...
by rudolfninja
Tue Dec 11, 2018 2:11 pm
Forum: C++ Development
Topic: wxDialog.ShowModal vs wxMessageDialog.ShowModal
Replies: 9
Views: 534

Re: wxDialog.ShowModal vs wxMessageDialog.ShowModal

I noticed, that button's OnPaint event isn't triggered when I close message box. Looks like this is the reason. Should this event be triggered and why it is not (if it should)?
by rudolfninja
Tue Dec 11, 2018 8:05 am
Forum: C++ Development
Topic: wxDialog.ShowModal vs wxMessageDialog.ShowModal
Replies: 9
Views: 534

Re: wxDialog.ShowModal vs wxMessageDialog.ShowModal

No, it is not just redraw problem. If a overlap the button with another dialog, then nothing changes, the button still looks disabled. The problem indeed might be in button state logic. I think, that drawing process is executed when modal dialog already has been shown, thus IsEnabled() returns false...