gtk con XQuartz

Hola Electores,

Otra vez con mas un tutorial sobre macOS, hoy tenemos como trabajar con gtk en Big Sur.

Para compilación:

gcc `pkg-config –cflags gtk+-3.0` -o example-0 mainwindow.cc `pkg-config –libs gtk+-3.0`

Pero primer, abrir mí gtk gist:

https://gist.github.com/vic3t3chn0/2e082126a7f89330f04cf2b10ba6e8c2

Pero, podemos testear con esto:

#include <gtk/gtk.h>

static void
activate (GtkApplication* app,
          gpointer        user_data)
{
  GtkWidget *window;

  window = gtk_application_window_new (app);
  gtk_window_set_title (GTK_WINDOW (window), "Window");
  gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
  gtk_widget_show_all (window);
}

int
main (int    argc,
      char **argv)
{
  GtkApplication *app;
  int status;

  app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
  g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
  status = g_application_run (G_APPLICATION (app), argc, argv);
  g_object_unref (app);

  return status;
}

Por fin:

 gcc `pkg-config --cflags gtk+-3.0` -o example-0 mainwindow.cc `pkg-config --libs gtk+-3.0`

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

1 + sixteen =

coder by Gleentech
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.