[Vala] Equivalent of Console.Clear() / Console.ReadKey()

2012-06-11 Thread Thomas H.P. Andersen
Hi,

I am porting glines (Five or more) in gnome-games to vala. To test
the logic I wrote a small cli interface to drive the game model. The
keypad arrows are used to move the cursor and 5 to do a click.

I use stdin.getc() and that kind of works but I am annoyed that I need
to press enter after each keypress. I would also like to clear the
console each time I print the new board state.

In c#/.net I would use Console.ReadKey() and Console.Clear() to
achieve that. Is there something equivalent in vala that I can use?

Cli code is here:
http://git.gnome.org/browse/gnome-games/tree/glines/src/glines-view-cli.vala?h=glines-vala

- Thomas
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Using vala, libgda, and waf

2012-06-11 Thread Abderrahim Kitouni
Hi,

   في ح، 10-06-2012 عند 00:22 -0400 ، كتب Steven Oliver:
 I have a very very simple pet project I'm writing and I want to 
 integrate some storage in a DB using libgda or GnomeDB (not real sure 
 what it's official name is now). I've pasted the basics of the top of my 
 wscript file. I cannot for the life of me figure out how to get waf to 
 recognize libgda. I'm still on Fedora 15 so I only have up to 
 libgda-4.0, which is fine, because if I can't get it to work having 5 
 won't help me any.
 
 I've tried several different opts.load statements in the below code 
 including libgda, libgda4, libgda-4.0. Does anyone know what the 
 right statement is???

(This has actually nothing to do with vala, it's really a waf question.)
Anyway, you need to use conf.check_cfg like it is done for glib,
something like:

conf.check_cfg(package = 'libgda-4.0',
   uselib_store = 'GDA',
   mandatory = True,
   args = '--cflags --libs')

and use GDA in the uselib for your application.

HTH,
Abderrahim

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Using vala, libgda, and waf

2012-06-11 Thread Steven Oliver

On 06/11/2012 04:46 AM, Abderrahim Kitouni wrote:

Hi,

في ح، 10-06-2012 عند 00:22 -0400 ، كتب Steven Oliver:

I have a very very simple pet project I'm writing and I want to
integrate some storage in a DB using libgda or GnomeDB (not real sure
what it's official name is now). I've pasted the basics of the top of my
wscript file. I cannot for the life of me figure out how to get waf to
recognize libgda. I'm still on Fedora 15 so I only have up to
libgda-4.0, which is fine, because if I can't get it to work having 5
won't help me any.

I've tried several different opts.load statements in the below code
including libgda, libgda4, libgda-4.0. Does anyone know what the
right statement is???

(This has actually nothing to do with vala, it's really a waf question.)
Anyway, you need to use conf.check_cfg like it is done for glib,
something like:

conf.check_cfg(package = 'libgda-4.0',
uselib_store = 'GDA',
mandatory = True,
args = '--cflags --libs')

and use GDA in the uselib for your application.

HTH,
Abderrahim

That has done the trick. Thank you very much! I will have to read up 
more on what exactly conf.check_cfg and opts.load do in waf.

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list