Register new instance of GtkApplication with gtk_application_new

This commit is contained in:
Michael Becker 2016-06-06 12:51:35 -04:00
parent 4aa3f60eab
commit 6fd9796e3a
3 changed files with 18 additions and 0 deletions

View File

@ -4,9 +4,17 @@ namespace UniversalEditor.Engines.GTK
{
public static class GtkApplication
{
private static IntPtr mvarHandle = IntPtr.Zero;
public static bool Initialize(ref int argc, ref string[] argv)
{
bool check = Internal.GTK.Methods.gtk_init_check (ref argc, ref argv);
if (!check)
return check;
mvarHandle = Internal.GTK.Methods.gtk_application_new ("net.alcetech.UniversalEditor", Internal.GTK.Constants.GApplicationFlags.None);
return check;
}
public static void Run()

View File

@ -4,6 +4,11 @@ namespace UniversalEditor.Engines.GTK.Internal.GTK
{
internal static class Constants
{
public enum GApplicationFlags
{
None = 0
}
public enum GtkWindowType
{
TopLevel = 0,

View File

@ -31,6 +31,11 @@ namespace UniversalEditor.Engines.GTK.Internal.GTK
[DllImport(LIBRARY_FILENAME)]
public static extern void gtk_window_set_title(IntPtr window, string title);
#region Application
[DllImport(LIBRARY_FILENAME)]
public static extern IntPtr gtk_application_new(string application_id, Constants.GApplicationFlags flags);
#endregion
#region Widget
[DllImport(LIBRARY_FILENAME)]
public static extern void gtk_widget_set_size_request(IntPtr widget, uint width, uint height);