Git Product home page Git Product logo

Comments (4)

madsmtm avatar madsmtm commented on September 26, 2024

Hey @aggmoulik, thanks for the interest! I would very much like some help with this project.

I initially started on a macOS / AppKit implementation, and progress on that went okay-ish, but quickly found that I was not satisfied with the available libraries for interacting with Objective-C, so I've started a whole endeavour to make that better (which is what now takes most of my time 🙄).
Missing from the current macOS implementation is probably the most important thing: the ability to add callbacks (e.g. functions that trigger when the item is clicked).

Anyhow, the general plan is split in two stages: The first is to develop and expose Rust APIs wrapping the platform-specific primitives (NSMenu, HMENU, GtkMenu and so on). These should be as zero-cost as possible, and allow for essentially everything you could want to do with the menu.

This includes:

  • Using it in the application’s menu bar
  • Contextual menus
  • Creating macOS pop-up menus
  • Using it in the macOS status bar
  • The macOS Dock menu
  • ...

Having the platform specific API, it will be much easier to go to the next stage: To try and build a common abstraction over it. So that's the approximate roadmap, though I don't have any dates for this or anything.

I'm thinking we want "backends" for at least the following GUI toolkits:

from menubar.

madsmtm avatar madsmtm commented on September 26, 2024

If you want something to work on, it would be nice to get started on a Windows/Win32 implementation, probably using stuff in windows-sys (instead of the older winapi, since the windows crates are directly supported by Microsoft).

I should note, picking this project as a starting point for learning Rust is quite tough even if you know C/C++ already, because it entails interacting safely with libraries written in those languages, and that requires quite intricate knowledge on Rust's safety and memory models. On the other hand, it's a good way to gain said knowledge.

from menubar.

aggmoulik avatar aggmoulik commented on September 26, 2024

Hey, @madsmtm Thank You for the detailed answer here. Yeah, I understand it will be a difficult task but at least I can try. I think supporting windows API is ok but how can I test or work on that because I have mac os and Linux.

from menubar.

madsmtm avatar madsmtm commented on September 26, 2024

Ah, fair, then don't bother with that, rather try doing the GTK (or Qt) implementation instead.

A few links on GTK menus I've accumulated in the past:

I think we'd want to target both GTK 3 and GTK 4? You should research what even makes sense for a library like this to do in GTK 4.

from menubar.

Related Issues (1)

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.