Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fwsetup-ng.git;a=commitdiff;h=6be24f534a62afb3acedb52db364b77da276050c

commit 6be24f534a62afb3acedb52db364b77da276050c
Author: James Buren <[email protected]>
Date:   Thu Aug 9 17:11:19 2012 -0500

extend newt usage some

diff --git a/setup.c b/setup.c
index dba39d8..d58c742 100644
--- a/setup.c
+++ b/setup.c
@@ -2,8 +2,10 @@

struct config
{
-       gint width;
-       gint height;
+       gint s_width;  // Screen Width
+       gint s_height; // Screen Height
+       gint w_width;  // Window Width
+       gint w_height; // Window Height
};

static struct config *config;
@@ -18,7 +20,18 @@ static gboolean newt_begin(void)

newtCls();

-       newtGetScreenSize(&config->width,&config->height);
+       newtGetScreenSize(&config->s_width,&config->s_height);
+
+       if(config->s_width < 80 || config->s_height < 24)
+       {
+               newtFinished();
+
+               return FALSE;
+       }
+
+       config->w_width = config->s_width;
+
+       config->w_height = config->s_height;

return TRUE;
}
@@ -29,9 +42,13 @@ static void newt_end(void)
}
#endif

-extern int main(void)
+extern gint main(void)
{
config = g_new0(struct config,1);

+       newt_begin();
+
+       newt_end();
+
return 0;
}
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to