Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various GTK deprecation warnings #2540

Closed
declension opened this issue Aug 17, 2017 · 7 comments
Closed

Various GTK deprecation warnings #2540

declension opened this issue Aug 17, 2017 · 7 comments

Comments

@declension
Copy link
Member

declension commented Aug 17, 2017

Steps

run python3 -Wall quodlibet/quodlibet.py

Output

Bit of a catch-all but some notable problems:

  • .../quodlibet/quodlibet/browsers/playlists/menu.py:33: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  • .../quodlibet/quodlibet/ext/events/animosd/osdwindow.py:292: PyGIDeprecationWarning: GObject.get_current_time is deprecated; use GLib.get_current_time instead delta = GObject.get_current_time() - self.fade_start_time
  • .../quodlibet/quodlibet/ext/events/animosd/osdwindow.py:292: PyGIDeprecationWarning: get_current_time is deprecated; use GLib.get_real_time() instead delta = GObject.get_current_time() - self.fade_start_time
  • .../quodlibet/quodlibet/ext/events/animosd/osdwindow.py:51: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "type" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  • .../quodlibet/quodlibet/qltk/pluginwin.py:404: DeprecationWarning: Gtk.Button.set_focus_on_click is deprecated
    errors.set_focus_on_click(False)
@lazka
Copy link
Member

lazka commented Aug 17, 2017

Note that GTK+ deprecation warnings in many cases mean that those things will be removed in gtk4 and might only have a replacement in gtk4.

declension added a commit that referenced this issue Aug 17, 2017
 * Use `python -Wall quodlibet/quodlibet.py` to see
 * The playlist menu one was very noisy
 * Various OSD plugin deprecation fixes
 * ditch `new()` when a normal constructor call will do
@zsau
Copy link
Contributor

zsau commented Jul 17, 2018

To replace the deprecated label.set_padding(1, 1), I initially used label.margin = 1. But apparently Gtk's .set_x methods are not always equivalent to assigning to .x directly, so would I have to do the following ugliness instead? Is it ever safe to assign directly to a Gtk object property that also has a setter?

label.set_margin_start(1)
label.set_margin_end(1)
label.set_margin_top(1)
label.set_margin_bottom(1)

@lazka
Copy link
Member

lazka commented Jul 18, 2018

xalign is special here as the method is a method of GtkMisc and the property is a property of GtkLabel

(I noticed the latter is missing in the API docs and I've filed pygobject/pgi-docgen#168)

@zsau
Copy link
Contributor

zsau commented Jul 19, 2018

After more testing, I discovered that nothing happens when I assign to a label's margin property (nor margin_start, margin_top, etc). Not sure if that's a bug.

set_margin_start() and friends work as expected, but there's no set_margin() so it seems the verbose way is the only working method.

@lazka
Copy link
Member

lazka commented Jul 19, 2018

oh, it's label.props.margin_start btw :)

@zsau
Copy link
Contributor

zsau commented Jul 19, 2018

...that explains why __clabel.xalign = 0 didn't work either. I wish there were a warning for that.

frestr added a commit that referenced this issue Nov 1, 2018
We are already aware of them (#2540), but they are shown by default in
pytest 3.9 and generate lots of noise.
@declension
Copy link
Member Author

Perhaps we should close this now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants