Compare commits
No commits in common. "e31c25db49f0e8fe7bbaa835583b7c2e84704f2d" and "f2aa387350e64fd4212f73fd4516eaf3ee4474aa" have entirely different histories.
e31c25db49
...
f2aa387350
5 changed files with 35 additions and 26 deletions
|
@ -64,9 +64,11 @@ namespace Buypeeb {
|
||||||
ed.ContentArea.PackStart(edEntry, true, true, 10);
|
ed.ContentArea.PackStart(edEntry, true, true, 10);
|
||||||
edEntry.Show();
|
edEntry.Show();
|
||||||
|
|
||||||
|
// TODO: pressing enter should submit the form
|
||||||
|
|
||||||
ResponseType accepted = (ResponseType)ed.Run();
|
ResponseType accepted = (ResponseType)ed.Run();
|
||||||
string response = edEntry.Text;
|
string response = edEntry.Text;
|
||||||
ed.Dispose();
|
ed.Destroy();
|
||||||
return (accepted == ResponseType.Ok, response);
|
return (accepted == ResponseType.Ok, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +99,7 @@ namespace Buypeeb {
|
||||||
private void ButtonQuitClicked(object sender, EventArgs a) {
|
private void ButtonQuitClicked(object sender, EventArgs a) {
|
||||||
MessageDialog md = new MessageDialog(null, DialogFlags.DestroyWithParent, MessageType.Question, ButtonsType.OkCancel, "Are you sure you want to quit?");
|
MessageDialog md = new MessageDialog(null, DialogFlags.DestroyWithParent, MessageType.Question, ButtonsType.OkCancel, "Are you sure you want to quit?");
|
||||||
ResponseType response = (ResponseType)md.Run();
|
ResponseType response = (ResponseType)md.Run();
|
||||||
md.Dispose();
|
md.Destroy();
|
||||||
if (response == ResponseType.Ok) {
|
if (response == ResponseType.Ok) {
|
||||||
Application.Quit();
|
Application.Quit();
|
||||||
}
|
}
|
||||||
|
|
20
Program.cs
Executable file
20
Program.cs
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
using System;
|
||||||
|
using Gtk;
|
||||||
|
|
||||||
|
namespace Buypeeb {
|
||||||
|
class Program {
|
||||||
|
[STAThread]
|
||||||
|
public static void Main(string[] args) {
|
||||||
|
Application.Init();
|
||||||
|
|
||||||
|
var app = new Application("org.buypeeb.buypeeb", GLib.ApplicationFlags.None);
|
||||||
|
app.Register(GLib.Cancellable.Current);
|
||||||
|
|
||||||
|
var win = new MainWindow();
|
||||||
|
app.AddWindow(win);
|
||||||
|
|
||||||
|
win.Show();
|
||||||
|
Application.Run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
2
build.sh
2
build.sh
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
mcs -pkg:gtk-sharp-3.0 -resource:ui.glade *.cs
|
|
|
@ -3,7 +3,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<StartupObject>Buypeeb.BuypeebApp</StartupObject>
|
<StartupObject>Buypeeb.Program</StartupObject>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
31
readme.md
31
readme.md
|
@ -7,13 +7,10 @@ i figured, may as well try and learn c#
|
||||||
|
|
||||||
## installing prerequisites
|
## installing prerequisites
|
||||||
you will need either:
|
you will need either:
|
||||||
- [dotnet core sdk](https://dotnet.microsoft.com/) (recommended, it's the easiest to use)
|
|
||||||
- [mono](https://www.mono-project.com/download/stable/) and [gtk sharp 3](https://github.com/GtkSharp/GtkSharp/)
|
- [mono](https://www.mono-project.com/download/stable/) and [gtk sharp 3](https://github.com/GtkSharp/GtkSharp/)
|
||||||
|
- [dotnet core sdk](https://dotnet.microsoft.com/)
|
||||||
|
|
||||||
### debian
|
### debian
|
||||||
#### dotnet
|
|
||||||
follow [these instructions](https://docs.microsoft.com/en-us/dotnet/core/install/linux-debian) to add the dotnet repo and install dotnet-sdk.
|
|
||||||
|
|
||||||
#### mono
|
#### mono
|
||||||
the packages you'll need are `mono-devel` and `gtk-sharp3`, so:
|
the packages you'll need are `mono-devel` and `gtk-sharp3`, so:
|
||||||
```
|
```
|
||||||
|
@ -23,11 +20,6 @@ sudo apt install mono-devel gtk-sharp3
|
||||||
follow [these instructions](https://docs.microsoft.com/en-us/dotnet/core/install/linux-debian) to add the dotnet repo and install dotnet-sdk.
|
follow [these instructions](https://docs.microsoft.com/en-us/dotnet/core/install/linux-debian) to add the dotnet repo and install dotnet-sdk.
|
||||||
|
|
||||||
### arch linux
|
### arch linux
|
||||||
#### dotnet
|
|
||||||
```
|
|
||||||
sudo pacman -S dotnet-sdk
|
|
||||||
```
|
|
||||||
|
|
||||||
#### mono
|
#### mono
|
||||||
```
|
```
|
||||||
sudo pacman -S mono gtk-sharp-3
|
sudo pacman -S mono gtk-sharp-3
|
||||||
|
@ -41,27 +33,24 @@ sudo pacman -S dotnet-sdk
|
||||||
- download and install ".NET Core SDK" from [this page](https://dotnet.microsoft.com/download)
|
- download and install ".NET Core SDK" from [this page](https://dotnet.microsoft.com/download)
|
||||||
- run `dotnet build` - this *should* pull in gtk3 automatically - if not, you'll need to [install it yourself](https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases/latest)
|
- run `dotnet build` - this *should* pull in gtk3 automatically - if not, you'll need to [install it yourself](https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases/latest)
|
||||||
|
|
||||||
i have no idea how to install mono with gtksharp properly on windows, and believe me i tried
|
this will install and use .NET core instead of mono but as far as i know it should be fine. don't try to use mono or you will die
|
||||||
|
|
||||||
## compiling
|
## compiling
|
||||||
|
### mono
|
||||||
|
```
|
||||||
|
mcs -pkg:gtk-sharp-3.0 -resource:ui.glade *.cs
|
||||||
|
```
|
||||||
### dotnet
|
### dotnet
|
||||||
```
|
```
|
||||||
dotnet build
|
dotnet build
|
||||||
```
|
```
|
||||||
|
|
||||||
### mono
|
|
||||||
```
|
|
||||||
mcs -pkg:gtk-sharp-3.0 -resource:ui.glade *.cs
|
|
||||||
```
|
|
||||||
|
|
||||||
## running
|
## running
|
||||||
### dotnet
|
|
||||||
```
|
|
||||||
dotnet run
|
|
||||||
```
|
|
||||||
|
|
||||||
### mono
|
### mono
|
||||||
```
|
```
|
||||||
mono ./BuypeebApp.exe
|
mono ./BuypeebApp.exe
|
||||||
```
|
```
|
||||||
|
### dotnet
|
||||||
|
```
|
||||||
|
dotnet run
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in a new issue