r/wxWidgets • • Jul 20 '20

How to compile in sublime?

0 Upvotes

Nowhere does it say how to run it, what do i even compile? god.


r/wxWidgets • • Aug 01 '25

Cloudflare access to wxwidgets.org

1 Upvotes

Hello,
I am trying to access forums.wxwidgets.org and docs.wxwodgets.org, but I am blocked by Cloudflare. This is very annoying. How can I get around this?


r/wxWidgets • • May 27 '20

Compiler looking for file that doesn't exist

1 Upvotes

I am using wxwidget 3.0 and followed all the instructions correctly, but now it looks for -lwxmsw30u that doesn't even exist anywhere. It is the only error


r/wxWidgets • • Jun 23 '22

coding help

0 Upvotes

i need a program that has something being drawn in a random location but for the life of me i can't figure out how to make it work


r/wxWidgets • • Sep 28 '18

Installing WxWidgets using CodeBlocks - Windows 7

Thumbnail
youtube.com
3 Upvotes

r/wxWidgets • • Jul 06 '25

Windows Darkmode

5 Upvotes

I have updated WxWidgets in UV-Remap to version 3.3 and think the new support for dark mode looks great. I've been waiting a long time for this and the customers even more so.


r/wxWidgets • • Dec 17 '24

A Custom wxWidget Minesweeper

8 Upvotes

wxWidgets has truly impressed me, and I'm glad it came to the rescue for those of us who use C++ as our primary language. Since learning C++, I’ve been excited to build GUI applications, and wxWidgets has become my tool of choice.

To test my mastery of the library, I built a working Minesweeper game that features an intuitive interface and smooth gameplay. You can clone and test the code here. The interface follows the design shown in the figure below. What do you think? Are there any suggestions for making the interface even more user-friendly?

Starting the game:

Game in progress:

When the game ends after losing:


r/wxWidgets • • May 12 '25

Save Dialog Box (MAC)

3 Upvotes

While working on a project using wxWidgets, I recently ran into an issue with the Dialog Boxes. Below is a segment of code that I used to create and show a dialog box, for purposes of saving an XML file. **WITHOUT changing any code, my program now fails to display the dialog box each time. When ShowModal() is called, it simply returns the wxID_CANCEL code. I have determined that this issue is most likely caused by some sort of issue between MAC OS and wxWidgets, but I cannot deterime why. Any Help on how to fix this would be greatly appreciated!


r/wxWidgets • • Feb 12 '25

Few questions from a wxWidgets Newbie

3 Upvotes

I have been developing using Qt and recently decided to explore wxWidgets since its license supports static linking.

I have successfully created a small application, using tutorials from the git. While developing, a few queries popped up in my head and I thought I could find someone here to help clarify.

Q1) The event system of wxWidgets follows somewhat MFC style, where you declare and define event table, then create an event and then post or send it. Coming from Qt, this seems too cumbersome, is there any alternative or simplified way for event handling?

eg:
Instead of:

eventids.h
enum EventIDs {
CUSTOM_CLOSE,
CUSTOM_CONTINUE
};

dialog.h
wxDECLARE_EVENT(wxEVT_DIALOG_CUSTOMEVENT, wxCommandEvent);

dialog.cpp
wxDEFINE_EVENT(wxEVT_DIALOG_CUSTOMEVENT, wxCommandEvent);

wxCommandEvent event(wxEVT_DIALOG_CUSTOMEVENT, EventIDs::CUSTOM_CLOSE);
wxPostEvent(this, event);

wxCommandEvent event(wxEVT_DIALOG_CUSTOMEVENT, EventIDs::CUSTOM_CONTINUE);
wxPostEvent(this, event);

To something like:

dialog.h
wxEvent customEvent;

dialog.cpp
wxPostEvent(customEvent);

Q2) How to implement custom uis? Do we have to draw all the controls ourselves? Is wxWebview reliable and can be statically linked?

Q3) A very minor one. The macros give squiggly lines in Visual Studio. How do I fix it?


r/wxWidgets • • May 15 '26

WxRuby3 v1.70 Released

Thumbnail
github.com
4 Upvotes

r/wxWidgets • • 7d ago

The Point of Sale (POS) program of my stores, that the cashiers use, uses wxWidgets! I made it myself

Post image
6 Upvotes

r/wxWidgets • • Dec 25 '25

wxEVT_ENTER_WINDOW and wxEVT_LEAVE_WINDOW on macOS

3 Upvotes

I was debugging an issue on Bambu Studio (https://github.com/bambulab/BambuStudio) on macOS, and my impression is that these ENTER and LEAVE events do not fire as expected.

For a given window, I'm getting enter and leave as the mouse goes into the child windows of the given windows, but I'm not getting leave and enter as the mouse moves away from the window to other (its parent) window, nor am I seeing those events when the mouse completely leaves the app's window... It's really quite sporadic.

My general question is this (admittedly having zero experience with wxWidgets): Is it possible the framework is misbehaving at that level on macOS? Or is this more likely an app issue of some sort? How tested and refined is this on macOS?


r/wxWidgets • • May 31 '26

WxAndroid

3 Upvotes

How's WxAndroid? It's working? Any working examples?

In the negative case, is there any way to develop with wxwidgets for Android?


r/wxWidgets • • Jun 08 '22

WxWidgets error

Thumbnail self.programminghelp
2 Upvotes

r/wxWidgets • • Jun 15 '22

Reducing the size of the wxWidgets library file

4 Upvotes

Hi, I make programs that only use a small number of widgets. So I want to only pack the widgets that I use with my program. Currently there isn't an easy way to build a wxWidgets library file that only contains the needed widgets. This is why I ask that we come up with a solution to this problem.


r/wxWidgets • • Aug 03 '20

Trouble compiling wxWidgets on linux. "missing separator. Stop" in makefile

3 Upvotes

Hi all, I'm trying to compile wxWidgets 3.1.4 on Manjaro Linux using the instructions from on the wiki. However, running make is yielding an output of "Makefile:8: *** missing separator. Stop.".

Now, admittedly, I'm not very well versed in Makefiles. But a quick google search has told me that this usually is an issue of tabs vs spaces. A lot of stackoverflow answers have led me to run cat -e -t -v MakeFile so that I can analyze the spacing to make sure I don't see anything out of the ordinary. Everything appears to be fine; I don't see any spaces where there should be tabs.

Here are the steps I'm taking immediately after downloading the source code in the tar.bz2 file

7z wxWidgets-3.1.4.tar.bz2 
7z wxWidgets-3.1.4.tar -owxWidgets-3.1.4 
cd wxWidgets-3.1.4 
mkdir gtk-build 
cd gtk-build 
chmod +x ../configure 
../configure 
make 

The last line is yielding "Makefile:8: *** missing separator. Stop.".

I've posted the generated MakeFile to pastebin here

I've also posted the output of cat -e -t -v MakeFile to pastebin here

Does anybody see anything out of the ordinary here? I believe I've followed all steps as they're outlined in the wiki.

edit: command formatting


r/wxWidgets • • Jun 23 '19

Having an issue compiling WxWidgets 3.1.2 on Windows 10

2 Upvotes

Running command prompt in administrator mode I run the following command in wxWidgets-3.1.2/build/msw

mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1

and this is the result.

if not exist gcc_mswudll mkdir gcc_mswudll

process_begin: CreateProcess(NULL, -c "if not exist gcc_mswudll mkdir gcc_mswudll", ...) failed.

make (e=2): The system cannot find the file specified.

makefile.gcc:5175: recipe for target 'gcc_mswudll' failed

mingw32-make: [gcc_mswudll] Error 2 (ignored)

gcc -c -o gcc_mswudll\wxregex_regcomp.o -O2 -mthreads -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_dll\mswu -D__WXMSW__ -D_UNICODE -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c

../../src/regex/regcomp.c:2179:0: fatal error: opening dependency file gcc_mswudll\wxregex_regcomp.o.d: No such file or directory

#include "regc_locale.c"

^

compilation terminated.

makefile.gcc:5787: recipe for target 'gcc_mswudll\wxregex_regcomp.o' failed

mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1

I was to assume this would work out of the box but there appears to be a file or directory missing? Am I missing something obvious?

I am using the following tutorial to install

https://www.youtube.com/watch?v=PlOhu1KkTZw

and website

http://wiki.codeblocks.org/index.php/Compiling_wxWidgets_3.0.0_to_develop_Code::Blocks_(MSW)

Thanks!


r/wxWidgets • • Oct 14 '23

Is there no native table in wxWidgets?

1 Upvotes

All I find online is wxGrid. But that is not the native table that the supported operating systems use. Does wxWidgets not support the native tables?


r/wxWidgets • • Oct 09 '23

Help me to get it working (please and thank you)

2 Upvotes

If anyone here is willing to help me set this up then please add me as a friend on discord or reply on this post with yours my name is "madbukscripts".
I've tried everything, watched countless videos and even tried Chat GPT and nothing worked, hopefully someone can help me, thanks.


r/wxWidgets • • Oct 04 '23

How could I make a splitter invisible?

3 Upvotes

Hi!

I want to make a splitter invisible.. I've not found any resources anywhere..

how could i do it? (C++)

(if I set the sash to be invisible it works ~ but then I can't interact with it anymore...
I'm using Ubuntu)


r/wxWidgets • • Mar 02 '21

Wxwidgets and SQL SERVER database

4 Upvotes

Hey, anyone knows how to connect SQL server database to wxwidgets I basically want to write a wxwidgets code in c++ to update data in the database


r/wxWidgets • • Feb 25 '21

Problems with changing the size of a button

3 Upvotes

I'm learning how to use wxWidgets and I've been using https://wiki.wxwidgets.org/Writing_Your_First_Application-Adding_A_Button as an a manual of sorts...

This is my code... https://i.imgur.com/wFedqZs.png

It displays a button that closes the program as intended, however the button is the whole frame even through I set it's size to be 10, 5. I have no clue how to fix this. All help is appreciated


r/wxWidgets • • Nov 05 '20

How to compile the Hello World program entirely with CMake and MinGW-Make?

2 Upvotes

Hello I am new to wxWidgets, and I want to compile the example progam that is mentioned in the home page of WxWidgets with CMake and MinGW-Make, but I got many errors all the time, I dont know what are the paths or the libraries that I need to include in the CMakeLists.txt file to get a succesful compilation. Now I'm using Windows 10, and I compile WxWidgets with MinGW-Make. Any help is good help, thanks.


r/wxWidgets • • Feb 20 '22

Custom Button with a unwanted dela

3 Upvotes

I have this code that creates a custom button from wx.Control. Tho, this button has a delay to it, which blocks it from correctly responding to presses, as shown in this video

the code is the follow, the important parts are the event handlers for EVT_LEFT_DOWN and EVT_LEFT_UP:

import wx
from wx.lib.newevent import NewCommandEvent

from constants import TEXT_COLOR

button_cmd_event, EVT_BUTTON = NewCommandEvent()

class Button(wx.Control):
    """ 
    Button with support for the following combinations:
    1. text
    2. icon + text
    3. icon

    :param wx.Window `parent`: parent window. Must not be ``None``.
    :param integer `id`: window identifier. A value of -1 indicates a default value.
    :param string `label`: the displayed button label.
    :param tuple `bmp`: the button icon as (wx.Bitmap, pos). pos can be one of 'top', 'left', 'right', 'bottom'.
    :param bool `center`: if True the contents of the button will be centered rather than left-aligned.
    :param bool `flat`: if True, the background will take on the color of the parent window.
    """
    def __init__(self, parent, id=wx.ID_ANY, label="", bmp=None, center=True,
                 pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.NO_BORDER, color="#f0f0f0",
                 font=None, *args, **kwargs):
        wx.Control.__init__(self, parent, id, pos, size, style, *args, **kwargs)

        self.parent = parent
        self.color = color

        if font:
            self.SetFont(font)
        else:
            self.SetFont(self.parent.GetFont())

        # Add spaces around a button with text
        if label != "":
            self.label = " {} ".format(label)
            self.padding = (10, 20, 10, 20)
        else:
            # Icon button
            self.label = label
            self.padding = (5, 6, 5, 6)

        self.buffer = None
        self.center = center
        self.outer_padding = 4
        self.size = None
        self.bmp = bmp

        self.mouse_in = False
        self.mouse_down = False
        self.focused = False
        self.highlighted = False

        self.Bind(wx.EVT_PAINT, self.OnPaint)
        self.Bind(wx.EVT_ERASE_BACKGROUND, lambda x: None)
        self.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus)
        self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)
        self.Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseLeave)
        self.Bind(wx.EVT_ENTER_WINDOW, self.OnMouseEnter)
        self.Bind(wx.EVT_LEFT_DOWN, self.OnMouseDown)
        self.Bind(wx.EVT_RIGHT_DOWN, lambda evt: evt.Skip())
        self.Bind(wx.EVT_LEFT_UP, self.OnMouseUp)
        self.Bind(wx.EVT_SIZE, self.OnSize)

    def OnPaint(self, event):
        wx.BufferedPaintDC(self, self.buffer)

    def OnSize(self, event):
        size = self.GetClientSize()

        # Make sure size is at least 1px to avoid
        # strange "invalid bitmap size" errors.
        if size[0] < 1:
            size = (1, 1)
        self.buffer = wx.Bitmap(*size)
        self.UpdateDrawing()

    def UpdateDrawing(self):
        dc = wx.MemoryDC()
        dc.SelectObject(self.buffer)
        dc = wx.GCDC(dc)
        self.OnDrawBackground(dc)
        self.OnDrawWidget(dc)
        del dc  # need to get rid of the MemoryDC before Update() is called.
        self.Refresh()
        self.Update()

    def OnDrawBackground(self, dc):
        dc.SetBackground(wx.Brush(self.parent.GetBackgroundColour()))
        dc.Clear()

    def OnDrawWidget(self, dc):
        dc.SetFont(self.GetFont())

        w, h = self.GetSize()

        dc.SetBrush(wx.Brush(self.color))
        dc.SetPen(wx.TRANSPARENT_PEN)
        dc.DrawRectangle(0, 0, w-1, h-1)

        thickness = 2
        if self.mouse_down or self.highlighted:
            dc.SetPen(wx.Pen(wx.Colour('#a0a0a0'), thickness))
            dc.DrawLine(0, 0, w-1, 0)
            dc.SetPen(wx.Pen(wx.Colour(self.color).ChangeLightness(45), thickness))
            dc.DrawLine(0, thickness, w-2, thickness)

            dc.SetPen(wx.Pen(wx.Colour('#a0a0a0'), thickness))
            dc.DrawLine(0, 0, 0, h-1)
            dc.SetPen(wx.Pen(wx.Colour(self.color).ChangeLightness(45), thickness))
            dc.DrawLine(thickness, thickness, thickness, h-2)


        elif self.mouse_in:
            dc.SetBrush(wx.Brush(wx.Colour(self.color).ChangeLightness(125)))

            dc.SetPen(wx.Pen(wx.Colour(self.color).ChangeLightness(125)))
            dc.DrawRectangle(1, 1, w - 3, h - 3)

            dc.SetPen(wx.Pen(wx.Colour(self.color).ChangeLightness(85)))
            dc.DrawRectangle(2, 2, w - 4, h - 4)

            dc.SetPen(wx.Pen("#a0a0a0", thickness))
            dc.DrawLine(w, 2, w, h)

            dc.SetPen(wx.Pen("#a0a0a0", thickness))
            dc.DrawLine(2, h, w, h)

        else:
            dc.SetPen(wx.Pen(wx.Colour(self.color).ChangeLightness(125)))
            dc.DrawRectangle(1, 1, w - 3, h - 3)

            dc.SetPen(wx.Pen(wx.Colour(self.color).ChangeLightness(85)))
            dc.DrawRectangle(2, 2, w - 4, h - 4)

            dc.SetPen(wx.Pen("#a0a0a0", thickness))
            dc.DrawLine(w, 2, w, h)

            dc.SetPen(wx.Pen("#a0a0a0", thickness))
            dc.DrawLine(2, h, w, h)

        txt_w, txt_h = dc.GetTextExtent(self.label)

        if self.bmp is not None:
            bmp = self.bmp
            bmp_w, bmp_h = bmp[0].GetSize()
            position = bmp[1]
        else:
            bmp = False

        if bmp:

            if position == "left":
                if self.center:
                    bmp_x = (w - txt_w - bmp_w) / 2
                    bmp_y = (h - bmp_h) / 2

                    txt_x = (w - txt_w - bmp_w) / 2 + bmp_w
                    txt_y = (h - txt_h) / 2
                else:
                    bmp_x = self.padding[3]
                    bmp_y = self.padding[0]

                    txt_x = self.padding[3] + bmp_w
                    if bmp_h > txt_h:
                        txt_y = (bmp_h - txt_h) / 2 + self.padding[0]
                    else:
                        txt_y = self.padding[0]

            if position == "right":
                if self.center:
                    bmp_x = (w - txt_w - bmp_w) / 2 + txt_w
                    bmp_y = (h - bmp_h) / 2

                    txt_x = (w - txt_w - bmp_w) / 2
                    txt_y = (h - txt_h) / 2
                else:
                    bmp_x = self.padding[3] + txt_w
                    bmp_y = self.padding[0]

                    txt_x = self.padding[3]
                    if bmp_h > txt_h:
                        txt_y = (bmp_h - txt_h) / 2 + self.padding[0]
                    else:
                        txt_y = self.padding[0]

            elif position == "top":
                if self.center:
                    bmp_x = (w - bmp_w) / 2
                    bmp_y = (h - bmp_h - txt_h) / 2

                    txt_x = (w - txt_w) / 2
                    txt_y = (h - bmp_h - txt_h) / 2 + bmp_h
                else:
                    if bmp_w > txt_w:
                        bmp_x = self.padding[3]
                        bmp_y = self.padding[0]

                        txt_x = (bmp_w - txt_w) / 2 + self.padding[3]
                        txt_y = self.padding[0] + bmp_h
                    else:
                        bmp_x = (txt_w - bmp_w) / 2 + self.padding[3]
                        bmp_y = self.padding[0]

                        txt_x = self.padding[3]
                        txt_y = self.padding[0] + bmp_h

            elif position == "bottom":
                if self.center:
                    bmp_x = (w - bmp_w) / 2
                    bmp_y = (h - txt_h - bmp_h) / 2 + txt_h

                    txt_x = (w - txt_w) / 2
                    txt_y = (h - txt_h - bmp_h) / 2
                else:
                    if bmp_w > txt_w:
                        bmp_x = self.padding[3]
                        bmp_y = self.padding[0] + txt_h

                        txt_x = (bmp_w - txt_w) / 2 + self.padding[3]
                        txt_y = self.padding[0]
                    else:
                        bmp_x = (txt_w - bmp_w) / 2 + self.padding[3]
                        bmp_y = self.padding[0] + txt_h

                        txt_x = self.padding[3]
                        txt_y = self.padding[0]

            dc.DrawBitmap(bmp[0], int(bmp_x), int(bmp_y))
        else:
            if self.center:
                txt_x = (w - txt_w) / 2
                txt_y = (h - txt_h) / 2
            else:
                txt_x = self.padding[3]
                txt_y = self.padding[0]

        if self.mouse_down:
            txt_x += thickness - (thickness/2)
            txt_y += thickness - (thickness/2)

        # Text color
        color = wx.Colour(TEXT_COLOR)
        dc.SetTextForeground(color)

        # Draw text
        dc.DrawText(self.label, int(txt_x), int(txt_y))

    def OnSetFocus(self, event):
        self.focused = True
        self.Refresh()

    def OnKillFocus(self, event):
        self.focused = False
        self.Refresh()

    def OnMouseEnter(self, event):
        self.mouse_in = True
        self.UpdateDrawing()

    def OnMouseLeave(self, event):
        self.mouse_in = False
        self.mouse_down = False
        self.UpdateDrawing()

    def OnMouseDown(self, event):
        self.mouse_down = True
        self.SetFocus()
        self.UpdateDrawing()
        event.Skip()

    def OnMouseUp(self, event):
        self.mouse_down = False
        self.SendButtonEvent()
        self.UpdateDrawing()

    def SendButtonEvent(self):
        wx.PostEvent(self, button_cmd_event(id=self.GetId(), value=0))

    def SetHighlighted(self, highlighted=True):
        self.highlighted = highlighted
        try:
            self.UpdateDrawing()
        except Exception:
            pass

    def DoGetBestSize(self):
        font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)

        dc = wx.ClientDC(self)
        dc.SetFont(font)

        txt_w, txt_h = dc.GetTextExtent(self.label)

        if self.bmp is not None:
            bmp = self.bmp
            bmp_w, bmp_h = bmp[0].GetSize()
            position = bmp[1]
        else:
            bmp = False

        if bmp:
            if position == "left" or position == "right":
                if bmp_h > txt_h:
                    size = (self.padding[3] + bmp_w + txt_w + self.padding[1],
                            self.padding[0] + bmp_h + self.padding[2])
                else:
                    size = (self.padding[3] + bmp_w + txt_w + self.padding[1],
                            self.padding[0] + txt_h + self.padding[2])
            else:
                if bmp_w > txt_w:
                    size = (self.padding[3] + bmp_w + self.padding[1],
                            self.padding[0] + bmp_h + txt_h + self.padding[2])
                else:
                    size = (self.padding[3] + txt_w + self.padding[1],
                            self.padding[0] + bmp_h + txt_h + self.padding[2])
        else:
            size = (self.padding[3] + txt_w + self.padding[1],
                    self.padding[0] + txt_h + self.padding[2])

        return wx.Size(size)

r/wxWidgets • • Feb 16 '22

Make parent fit to its children/sizers

3 Upvotes

I have this app in WxPython, but I believe I can recieve a C++ answer for it.
I'm trying to make so the frame and the info Panel fit to their sizers/children widgets. Tried googling and couldn't find nothing about it.

import wx

class Info(wx.Panel):
    def __init__(self, parent):
        super().__init__(parent=parent, style=wx.BORDER_DOUBLE)

        self.SetBackgroundColour('white')

        box = wx.StaticBox(self, -1, "Info")
        # box.SetBackgroundColour('#f0f0f0')
        box_sizer = wx.StaticBoxSizer(box, wx.VERTICAL)

        st_success_rate = wx.StaticText(self, -1, 'Success rate: 0 out of 0')
        # st_success_rate.SetBackgroundColour('#f0f0f0')
        box_sizer.Add(st_success_rate, 0, wx.TOP | wx.LEFT, 5)

        st_percentage = wx.StaticText(self, -1, 'Percentage: 0%')
        # st_percentage.SetBackgroundColour('#f0f0f0')
        box_sizer.Add(st_percentage, 0, wx.TOP | wx.LEFT, 5)

        border = wx.BoxSizer()
        border.Add(box_sizer, 1, wx.EXPAND | wx.ALL, 5)
        self.SetSizer(border)

class MyFrame(wx.Frame):
    def __init__(self):
        super().__init__(None, -1, "test")
        self.info = Info(self)

        self.SetBackgroundColour('#f0f0f0')

        border = wx.BoxSizer(wx.VERTICAL)
        border.Add(self.info, 0, wx.CENTER | wx.ALL, 5)
        self.SetSizer(border)

        self.Show()


app = wx.App()
frame = MyFrame()
app.MainLoop()