hi,

I am trying to wrap gtk based UI in rust. Not an expert in rust.


i created a  libgui.so out of these files

gui.h
====
void showGtkUI(int argc, char* argv[]);


gui.c
====
#include "gui.h"
#include <gtk/gtk.h>
void showGtkUI(int argc, char* argv[]){

    GtkWidget *window;
    //int argc = 1;
    //char **argv = {"hi"};
    gtk_init (&argc, &argv);

    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_widget_show  (window);

    gtk_main ();

}


now I want to write a rust-gui.rs  ( a rust wrapper for this), but could
not get any idea how to
supply the argc and argv .

rust-gui.rs
============

use libc::{c_char, c_void, c_int, c_uint};
//use std;
extern mod gui{
  fn showGtkUI(argc:c_int, argv:**c_char);
}


fn main( /* what can be args */ ) {
    // what should I do here.
}


i tried vec [str] etc but every time i get compile errors.

any help.

TIA
amit
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to