1
0

more adventures in the world of guis

This commit is contained in:
dtb 2022-10-05 21:41:22 -04:00
parent 5c9cda563c
commit 2de50f184b
2 changed files with 21 additions and 8 deletions

View File

@ -35,14 +35,15 @@ int main(int argc, char *argv[]){
argv0 = argv[0]; argv0 = argv[0];
fake_argv[0] = argv0; fake_argv[0] = argv0;
f = 'x';
while((c = getopt(argc, argv, "h:rv:x")) != -1) while((c = getopt(argc, argv, "h:v:wx")) != -1)
switch(c){ switch(c){
case 'h': case 'h':
h = atoi(optarg); h = atoi(optarg);
break; break;
case 'r': case 'w':
f = 'r'; f = 'w';
break; break;
case 'v': case 'v':
v = atoi(optarg); v = atoi(optarg);
@ -78,16 +79,21 @@ activate(GtkApplication *app, gpointer user_data){
GtkWidget *button; GtkWidget *button;
int c; int c;
char *s; char *s;
GtkWidget *scrolledwindow;
GtkWidget *window; GtkWidget *window;
window = gtk_application_window_new(app); window = gtk_application_window_new(app);
gtk_window_set_title(GTK_WINDOW(window), "Bitch"); gtk_window_set_title(GTK_WINDOW(window), "Bitch");
gtk_window_set_default_size(GTK_WINDOW(window), h, v); gtk_window_set_default_size(GTK_WINDOW(window), h, v);
box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); scrolledwindow = gtk_scrolled_window_new();
gtk_widget_set_halign(box, GTK_ALIGN_CENTER); gtk_scrolled_window_set_overlay_scrolling(GTK_SCROLLED_WINDOW(scrolledwindow), 1);
gtk_widget_set_valign(box, GTK_ALIGN_CENTER); gtk_window_set_child(GTK_WINDOW(window), scrolledwindow);
gtk_window_set_child(GTK_WINDOW(window), box);
box = gtk_list_box_new();
//gtk_widget_set_halign(box, GTK_ALIGN_CENTER);
//gtk_widget_set_valign(box, GTK_ALIGN_CENTER);
gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(scrolledwindow), box);
for(;;){ for(;;){
if(fgets(buf, sizeof(buf) / sizeof(*buf), stdin) == NULL){ if(fgets(buf, sizeof(buf) / sizeof(*buf), stdin) == NULL){