Created
September 7, 2019 02:04
-
-
Save andreldm/f96da5f58276bc9fe076d4d072a9ee97 to your computer and use it in GitHub Desktop.
Non-transient dialog with minimize button (which doesn't work)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Build: | |
* gcc $(pkg-config --cflags gtk+-3.0) sample.c -o sample $(pkg-config --libs gtk+-3.0) | |
*/ | |
#include <gtk/gtk.h> | |
int main (int argc, char *argv[]) | |
{ | |
GtkWidget *window, *dialog; | |
gtk_init (&argc, &argv); | |
window = gtk_window_new (GTK_WINDOW_TOPLEVEL); | |
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER); | |
gtk_window_set_default_size (GTK_WINDOW (window), 640, 480); | |
dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL); | |
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER); | |
gtk_window_set_default_size (GTK_WINDOW (dialog), 320, 240); | |
gtk_window_set_type_hint (GTK_WINDOW (dialog), GDK_WINDOW_TYPE_HINT_DIALOG); | |
// gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window)); | |
g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (gtk_main_quit), NULL); | |
gtk_widget_show_all (window); | |
gtk_widget_show_all (dialog); | |
gtk_main (); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment