Notebook not updating properly Linux

18 views
Skip to first unread message

charl...@gmail.com

unread,
Jul 14, 2023, 9:47:49 AM7/14/23
to wxPython-users
Hello -

4.2.1 gtk3 (phoenix) wxWidgets 3.2.2.1

Just trying to create two pages, with a bit of text and a background color.
On Linux (Ubuntu 22.04, x86_64) when I select page two, page one is still rendered underneath : color and text, so you get a corrupted display that looks like this:

Screenshot from 2023-07-14 06-37-02.png

Looks fine on mac: 4.2.1 osx-cocoa (phoenix) wxWidgets 3.2.2.1

Screenshot from 2023-07-14 06-38-43.png

Code to reproduce:

#!/usr/bin/python

import wx
app = wx.App()
frame = wx.Frame(None, title='notebook test')
notebook = wx.Notebook(frame)

one = wx.Window(notebook)
one.SetBackgroundColour(wx.GREEN)
wx.StaticText(one, label="one")
print(one.GetBackgroundColour())
notebook.AddPage(one, "One")

two = wx.Window(notebook)
wx.StaticText(two, label="two")
# we didn't set a background color for page two,
# we expect it to be the platform default (gray/white/etc)
print(two.GetBackgroundColour())
notebook.AddPage(two, "Two")

frame.Show()
app.MainLoop()


Thanks for any pointers/workarounds. 
-ck



Matthias Brennwald

unread,
Jul 14, 2023, 10:31:44 AM7/14/23
to wxpytho...@googlegroups.com
Running your code example works as expected on my Debian 12 machine with wx 4.2.1 and Wayland. I don't think your issue is a "general Linux" thing, but might be related to the specific packages / versions installed on your machine.
03b54a1d-0265-4a7b-a468-eb1b1b473eb5
2a91de67-76d1-410c-ad83-f1b1522a692c
Reply all
Reply to author
Forward
0 new messages