Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup on fedora required code changes #185

Closed
jpercyasnet opened this issue Feb 12, 2021 · 6 comments
Closed

setup on fedora required code changes #185

jpercyasnet opened this issue Feb 12, 2021 · 6 comments

Comments

@jpercyasnet
Copy link

I am running on fedora 33 and installed rust and gtk4-devel using dnf. When trying to get rust to compile I had to add
[dependencies]
gtk4 = { git = "https://github.com/gtk-rs/gtk4.git" }
to the Cargo.toml (just using gtk = .. did not work)
Also I compile the basic.rs code in the example, but any reference to gtk, I had to change to gtk4.
Is this an issue?

@sdroege
Copy link
Member

sdroege commented Feb 12, 2021

Can you describe what exactly you were compiling and how? gtk4 = { git = "https://github.com/gtk-rs/gtk4-rs.git" } would be correct for a crate outside this repository.

@jpercyasnet
Copy link
Author

jpercyasnet commented Feb 12, 2021

this is the main.rs file:

//! # Basic Sample
//!
//! This sample demonstrates how to create a toplevel `window`, set its title, size and
//! position, how to add a `button` to this `window` and how to connect signals with
//! actions.
use gtk4::prelude::*;

use std::env::args;

fn build_ui(application: &gtk4::Application) {
    let window = gtk4::ApplicationWindow::new(application);

    window.set_title(Some("First GTK Program"));
    window.set_default_size(350, 70);

    let button = gtk4::Button::with_label("Click me!");

    window.set_child(Some(&button));

    window.show();
}

fn main() {
    let application =
        gtk4::Application::new(Some("com.github.gtk-rs.examples.basic"), Default::default())
            .expect("Initialization failed...");

    application.connect_activate(|app| {
        build_ui(app);
    });

    application.run(&args().collect::<Vec<_>>());
}

and this is the Cargo.toml file:

[package]
name = "basictest"
version = "0.1.0"
authors = ["jp"]
edition = "2018"

[dependencies]
gtk4 = { git = "https://github.com/gtk-rs/gtk4.git" }

just did the normal cargo new basictest and executed cargo run in the new directory.

@sdroege
Copy link
Member

sdroege commented Feb 13, 2021

Yes that looks correct but you should better use https://github.com/gtk-rs/gtk4-rs.git instead of https://github.com/gtk-rs/gtk4.git. You're currently using the old repository.

What exactly is the problem though?

@bilelmoussaoui
Copy link
Member

Yes that looks correct but you should better use https://github.com/gtk-rs/gtk4-rs.git instead of https://github.com/gtk-rs/gtk4.git. You're currently using the old repository.

We should archive all the old gtk4 repositories as they are just very confusing and are not useful any more.
cc @GuillaumeGomez

@GuillaumeGomez
Copy link
Member

Done!

@bilelmoussaoui
Copy link
Member

Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants