Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

NickvisionApps/GirExt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

THIS PROJECT IS NOW DEPRECATED AS GIR.CORE NOW INCLUDES THESE FEATURES

Nuget

Nickvision.GirExt

Logo

Extensions library for gir.core

gir.core provides C# bindings for GObject based libraries like GTK, and while it is an awesome tool, it's not complete. It misses some methods that you might want to use in your apps, and this is the case for Nickvision applications. The goal of GirExt is to provide missing parts and helper functions to make writing gir.core apps easier today.

Currently implemented:

  • Gdk
    • Clipboard
      • ReadTextAsync
    • Helpers[1]
      • GdkExt.RGBA
        • Parse
        • ToString
  • Gtk
    • AlertDialog
      • ChooseAsync
    • ColorDialog
      • ChooseRgbaAsync (returns GdkExt.RGBA)
    • FileDialog
      • OpenAsync
      • OpenMultipleAsync
      • SaveAsync
      • SelectFolderAsync
      • SelectMultipleFoldersAsync
    • FileLauncher
      • LaunchAsync
      • OpenContainingFolderAsync
    • UriLauncher
      • LaunchAsync
    • Helpers[1]
      • ColorDialog
        • GetExtRgba
        • SetExtRgba
      • FlowBox
        • GetSelectedChildrenIndices
      • ListBox
        • GetSelectedRowsIndices
  • External[2]
    • Unity[3]
      • LauncherEntry
        • GetForDesktopID
        • SetProgressVisible
        • SetProgress

[1] Helpers are functions that do not follow gir.core API, they are workarounds created to avoid complexity that is required for proper implementation of related methods.

[2] External are bindings for libraries that are not a part of gir.core, but may be useful when creating GTK apps.

[3] Linux-only.

If you develop apps with gir.core and found something missing that is not implemented here, feel free to open an issue with request or send a PR with your implementation.

Installation

Download on Nuget

Example

using static Nickvision.GirExt.GtkExt;
...
try
{
    var file = await fileDialog.OpenAsync(window);
    var fileLauncher = Gtk.FileLauncher.New(file);
    await fileLauncher.LaunchAsync(window);
}
catch
{
    Console.WriteLine("Failed to open a file.");
}