pybee / toga-demo

A demonstration of the capabilities of the Toga widget toolkit.
BSD 3-Clause "New" or "Revised" License
16 stars 9 forks source link

toga-demo fails with gtk backend #6

Closed apollo13 closed 8 years ago

apollo13 commented 8 years ago

I am getting this on debian stable:

Traceback (most recent call last):
  File "/home/florian/.local/lib/python3.4/site-packages/toga_gtk/app.py", line 123, in _startup
    self.startup()
  File "/home/florian/.local/lib/python3.4/site-packages/toga_demo/app.py", line 42, in startup
    right_content.add(toga.Button('Hello world %s' % b, on_press=self.button_handler, style=CSS(margin=20)))
  File "/home/florian/.local/lib/python3.4/site-packages/toga_gtk/widgets/button.py", line 12, in __init__
    self._create()
  File "/home/florian/.local/lib/python3.4/site-packages/toga/interface/widgets/base.py", line 136, in _create
    self._configure(**self._config)
  File "/home/florian/.local/lib/python3.4/site-packages/toga/interface/widgets/button.py", line 9, in _configure
    self.label = label
  File "/home/florian/.local/lib/python3.4/site-packages/toga/interface/widgets/button.py", line 22, in label
    self._set_label(value)
  File "/home/florian/.local/lib/python3.4/site-packages/toga_gtk/widgets/button.py", line 22, in _set_label
    self.rehint()
  File "/home/florian/.local/lib/python3.4/site-packages/toga_gtk/widgets/button.py", line 33, in rehint
    if width.minimum_width > 0:
AttributeError: 'tuple' object has no attribute 'minimum_width'

Seems like width is not what it is supposed to be, I'll take a look later, this is just so it does not get lost :D

freakboy3742 commented 8 years ago

Hrm. That's really odd. What distro and version of Linux are you using?

apollo13 commented 8 years ago

This was on debian stable (at home). Running on unstable @ the office with your latest fixes works nicely but results in a lot of:

(toga-demo:3351): Gtk-WARNING **: Allocating size to GtkButton 0x1eb96c0 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
freakboy3742 commented 8 years ago

Hrm... that's an interesting bug. Do these messages just get printed once, or do you seem more instances whenever you resize the window or the split pane?

Also - what's the current GTK+ version on Unstable?

freakboy3742 commented 8 years ago

Moving this to pybee/toga-gtk#11