construct-editor icon indicating copy to clipboard operation
construct-editor copied to clipboard

Gtk-Warning 'Negative content width' in WxConstructHexEditor

Open rvanlaar opened this issue 2 years ago • 0 comments

The following error occurs:

(example.py:46458): Gtk-WARNING **: 15:32:24.623: Negative content width -22 (allocation 12, extents 17x17) while allocating gadget (node button, owner GtkButton)

Changing the value of 12 tot 35 shows the '«' and gets rid of the error. on line: https://github.com/timrid/construct-editor/blob/main/construct_editor/wx_widgets/wx_construct_hex_editor.py#L113

Steps to reproduce: Run the example program:

## example.py
import wx
import construct as cs
from construct_editor.wx_widgets import WxConstructHexEditor

constr = cs.Struct(
    "a" / cs.Int16sb,
    "b" / cs.Int16sb,
)
b = bytes([0x12, 0x34, 0x56, 0x78])

app = wx.App(False)
frame = wx.Frame(None, title="Construct Hex Editor", size=(1000, 200))
editor_panel = WxConstructHexEditor(frame, construct=constr, binary=b)
editor_panel.construct_editor.expand_all()
frame.Show(True)
app.MainLoop()

Run the program, hoover over the divider in the middle and this error will show in the terminal:

(example.py:46458): Gtk-WARNING **: 15:32:24.623: Negative content width -22 (allocation 12, extents 17x17) while allocating gadget (node button, owner GtkButton)

Versions: construct-editor: 0.1.4 construct: 2.10.68 wxpython: 4.2.1 ubuntu: 22.04.2

rvanlaar avatar Jul 08 '23 13:07 rvanlaar