Coder Social home page Coder Social logo

Do not use gtk_dialog_run about gnomecast HOT 3 OPEN

nacho avatar nacho commented on June 6, 2024
Do not use gtk_dialog_run

from gnomecast.

Comments (3)

keredson avatar keredson commented on June 6, 2024

the idle_add is necessary because we're triggering it outside the main loop. that will be required regardless.

i'm a pretty amateurish GTK dev. could you explain or link to an explanation why dialog.run() is worse than listening to a signal? i tend to do it when i can because it's just simpler code, but if i'm stepping on my own feet w/o knowing it i definitely want to know. docs https://developer.gnome.org/gtk3/stable/GtkDialog.html#gtk-dialog-run don't seem to suggest it's deprecated. also has this:

Note that even though the recursive main loop gives the effect of a modal dialog (it prevents the user from interacting with other windows in the same window group while the dialog is run), callbacks such as timeouts, IO channel watches, DND drops, etc, will be triggered during a gtk_dialog_run() call.

which would indicate it doesn't block the main loop, just creates a modal-like experience. (which i'm looking for here.)

from gnomecast.

nacho avatar nacho commented on June 6, 2024

I think this comment explains it quite well: https://blogs.gnome.org/desrt/2012/02/26/sprout-and-the-bean/#comment-1225

from gnomecast.

keredson avatar keredson commented on June 6, 2024

huh, that article is from 2012 and says:

we’re going to deprecate gtk_dialog_run() next cycle. (yay!)

i wonder why that didn't happen.

from gnomecast.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.