Code Monkey home page Code Monkey logo

msgbox-rs's Introduction

This repository is archived

msgbox-rs

OS Build Status
Linux & OS X Build Status
Windows Build status
extern crate msgbox;

use msgbox::IconType;

fn main() {
    msgbox::create("Hello Title", "Hello World!", IconType::Info);
}

Simple, cross-platform message box GUI library.

All it does is to show a message box modal with an OK button, which runs synchronously.

It supports multi-platform, and maintains separate dependencies per platform, thus light-weight.

Example use case is to show a modal when an error occurs in OpenGL applications.

  • Synchronous Message Modal
  • Multi-platform (Linux GTK3+, Windows and OS X)
  • Light-weight

Platform support

  • Linux with GTK 3+ (Tested on Ubuntu Gnome 16.04)
  • Windows (Tested on Windows 8.1 and 10)
  • OS X (Tested on MacOS 10.13.3 High Sierra)

Dev Requirements

Linux

  • libgtk-3-dev for apt
  • gtk3-devel for yum

Windows

  • Windows version compatible with winapi

OS X

  • Tested on High Sierra 10.13.3, but it should work on 10.3+

License

Distributed under MIT License

msgbox-rs's People

Contributors

bekker avatar getreu avatar guillaumegomez avatar hdhoang avatar jbeich avatar lukaskalbertodt avatar pythonesque avatar repi avatar zarik5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

msgbox-rs's Issues

a library should not "println", but return an error type

Thank you for this useful crate.

It would be very useful to know if the message box finally popped up or if there had been some error.

Please consider the following extract of linux.rs.

pub fn create(title:&str, content:&str, icon_type:IconType) {
    if gtk::init().is_err() {
        println!("Failed to initialize GTK.");
        println!("{}", content);
        return;
    }

Instead of dumping on the console with println!() I suggest returning some error type. Otherwise there is no way for the caller to know if something went wrong!

Hide console

Hi, if you hide console with:
#![windows_subsystem = "windows"]
The MsgBox close instantly

[Enhancement Request] More button types

It will be nice if I can choose to display "OK", "OK or Cancel", "Yes or No", "Abort, Retry or Ignore" and anything else and get known which button user click by returned value.

It should not make this library too heavy. But makes it more useful.

Android Support

Currently this crate is missing android support.
I'm investigating what this would require.

0.1.1 doesn't build in nightly

Building on Linux with rustc 1.36.0-dev (50a0defd5 2019-05-21) cause error:

Compiling glib v0.1.3
error[E0119]: conflicting implementations of trait `value::SetValueOptional` for type `&_`:
   --> /home/o01eg/.cargo/registry/src/github.com-1ecc6299db9ec823/glib-0.1.3/src/value.rs:509:1
    |
478 | impl<'a, T: ?Sized + SetValueOptional> SetValueOptional for &'a T {
    | ----------------------------------------------------------------- first implementation here
...
509 | impl<T: IsA<Object>> SetValueOptional for T {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_`
    |
    = note: downstream crates may implement trait `object::IsA<object::Object>` for type `&_`

error[E0119]: conflicting implementations of trait `value::SetValue` for type `&_`:
   --> /home/o01eg/.cargo/registry/src/github.com-1ecc6299db9ec823/glib-0.1.3/src/value.rs:503:1
    |
472 | impl<'a, T: ?Sized + SetValue> SetValue for &'a T {
    | ------------------------------------------------- first implementation here
...
503 | impl<T: IsA<Object>> SetValue for T {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_`
    |
    = note: downstream crates may implement trait `object::IsA<object::Object>` for type `&_`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0119`.
error: Could not compile `glib`.
warning: build failed, waiting for other jobs to finish...
error: build failed

It still build on stabe 1.34

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.