Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • pygobject pygobject
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 307
    • Issues 307
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 33
    • Merge requests 33
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • pygobjectpygobject
  • Issues
  • #371
Closed
Open
Issue created Dec 15, 2019 by Dan Yeaw@danyeawContributor

Use Gtk.Widget Method instead of Gtk.Button for set_focus_on_click

Gtk.Button.set_focus_on_click was deprecated in GTK 3.2, and replaced by Gtk.Widget.set_focus_on_click. Gtk.Button inherits from Gtk.Widget, but if you call Gtk.Button.set_focus_on_click it introspects to gtk_button_set_focus_on_click instead of gtk_widget_set_focus_on_click.

What this results in for a simple example is:

button = Gtk.Button()
button.set_focus_on_click(False)
DeprecationWarning: Gtk.Button.set_focus_on_click is deprecated
    button.set_focus_on_click(False)

You can work around this by directly calling the Gtk.Widget method like:

button = Gtk.Button()
Gtk.Widget.set_focus_on_click(button, False)

Could we modify PyGObject so that it doesn't call the deprecated method at all?

Assignee
Assign to
Time tracking