Giter Site home page Giter Site logo

GtkApplication about gtk.jl HOT 10 OPEN

tknopp avatar tknopp commented on July 20, 2024
GtkApplication

from gtk.jl.

Comments (10)

vtjnash avatar vtjnash commented on July 20, 2024

I hadn't seen that API before. That is awesome. (note that GApplication is a Gtk+ 2 API also!)

GApplication tells you exactly what you need to call to emulate g_application_run (it consists of calling g_application_register() then g_application_activate() or g_application_open(), then exit if g_application_is_remote() otherwise run the mainloop. (although it's unclear how you would trigger the command-line signal).

(Alternatively, now that JuliaLang/julia#5687 is merged, we could flip the ownership of the mainloop so that Gtk is the primary and Julia is triggered from a timer.)

from gtk.jl.

tknopp avatar tknopp commented on July 20, 2024

Ah yes I see. I had only read the information text to GtkApplication and thought that gtk-init is called in the constructor. I also had not seen that all this depends on libgio.
So it seems that we want to wrap these application parts of GIO and then add GtkApplication window on top of that.

I am not so sure about whether we should flip the ownership of the mainloop. The other way around seems to be more natural for Gtk bindings. But if I get it right we would loose the possibility to construct Gtk widgets on the REPL, right? Or, more concretely, we could only construct them but the callbacks would not be invoked until gtk-init is called, which would block.

from gtk.jl.

vtjnash avatar vtjnash commented on July 20, 2024

That's the fun part about flipping it correctly -- it would be completely transparent to the user.

from gtk.jl.

timholy avatar timholy commented on July 20, 2024

I love how stuff gets tackled on a "deep" level in this community, and how it opens up new possibilities.

from gtk.jl.

vtjnash avatar vtjnash commented on July 20, 2024

It's definitely helpful to both maintain a package and be deeply into the core of julia.

from gtk.jl.

timholy avatar timholy commented on July 20, 2024

Try that with Matlab πŸ˜„.

from gtk.jl.

vtjnash avatar vtjnash commented on July 20, 2024

@tknopp feel free to submit a pull request for this. I've now switched the mainloop ownership on master (aside from being mildly sketchy that we do a stack replacement while inside a Gtk callback). But now you can do whatever you want with the main loop!

from gtk.jl.

tknopp avatar tknopp commented on July 20, 2024

@vtjnash I am not entirely sure if I find much time for Gtk.jl development in the near future so I won't commit myself to this.

My main motivation here was to get a global main menu on OSX when I was developing Julietta. I have not yet ported Julietta to the new Gtk.jl API. In general I think it is a quite nice testbed for Gtk.jl.

from gtk.jl.

vtjnash avatar vtjnash commented on July 20, 2024

No pressure. Just thought I would point out how the situation has changed recently, making this much easier to play around with

from gtk.jl.

tknopp avatar tknopp commented on July 20, 2024

Yes, thanks for the hint. I am really looking forward playing around with this when I find time.

from gtk.jl.

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.