Re: [Vala] Listing directory content with GIO

2009-05-06 Thread Sam Liddicott
Yeah... Nicer to be implicit though. Sam -Original Message- From: Levi Bard Sent: Wednesday, May 06, 2009 7:48 PM To: Sam Liddicott Subject: Re: [Vala] Listing directory content with GIO On Wed, May 6, 2009 at 2:42 PM, Sam Liddicott wrote: > I prefer: > > while ((FileInfo fileinfo = en

Re: [Vala] Listing directory content with GIO

2009-05-06 Thread Levi Bard
On Wed, May 6, 2009 at 2:42 PM, Sam Liddicott wrote: > I prefer: > > while ((FileInfo fileinfo = enumerator.next_file(null)) != null) > { >  stdout.printf("%s\n", fileinfo.get_name()); > } > > Which allows you to have a fake scope surrounding the loop to keep the loop > variable temporary to the

Re: [Vala] Listing directory content with GIO

2009-05-06 Thread Sam Liddicott
I prefer: while ((FileInfo fileinfo = enumerator.next_file(null)) != null) { stdout.printf("%s\n", fileinfo.get_name()); } Which allows you to have a fake scope surrounding the loop to keep the loop variable temporary to the loop. I don't know any language that likes it though :-( Sam __

Re: [Vala] How to call base constructors

2009-05-06 Thread Frederik
Adi Roiban wrote: > I'm trying to extend the Gtk.CheckMenuItem and unfortunately there are > no set_label or set_mnemonic methods. > > I was thinking to call the base constructor, but instead of > gtk_check_menu_item_new_with_label, vala generates > gtk_check_menu_item_construct_with_label > > D

Re: [Vala] How to call base constructors

2009-05-06 Thread Jan Hudec
Vlad Grecescu writes: > On Mon, May 4, 2009 at 4:40 PM, Adi Roiban wrote: > > I'm trying to extend the Gtk.CheckMenuItem and unfortunately there are > > no set_label or set_mnemonic methods. > > I was thinking to call the base constructor, but instead of > > gtk_check_menu_item_new_with_label, v

Re: [Vala] Execute external command

2009-05-06 Thread Levi Bard
> What is the right way to open an external command and get its output in Vala? One of GLib.Process.spawn*? ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

[Vala] Execute external command

2009-05-06 Thread Jan Niklas Hasse
What is the right way to open an external command and get its output in Vala? ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

Re: [Vala] Listing directory content with GIO

2009-05-06 Thread Jan Niklas Hasse
Thanks! ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

Re: [Vala] Listing directory content with GIO

2009-05-06 Thread Frederik
Jan Niklas Hasse wrote: > I've tried to list the files in a directory (not using async > functions). This is what I've got: > > var libPath = File.new_for_path("/lib/"); > var enumerator = > libPath.enumerate_children(FILE_ATTRIBUTE_STANDARD_NAME, 0, null); > var fileinfo = enumerator.next_file(nu

Re: [Vala] Listing directory content with GIO

2009-05-06 Thread Daniel Lucraft
Hi Jan, I'm doing it like this: string name; var d = Dir.open("/path/to/dir"); while ((name = d.read_name()) != null) {  stdout.printf("dir: %s\n", name); } best, DBL Daniel Benjamin Lucraft www.daniellucraft.com/blog twitter.com/danlucraft 2009/5/6 Jan N

[Vala] Listing directory content with GIO

2009-05-06 Thread Jan Niklas Hasse
I've tried to list the files in a directory (not using async functions). This is what I've got: var libPath = File.new_for_path("/lib/"); var enumerator = libPath.enumerate_children(FILE_ATTRIBUTE_STANDARD_NAME, 0, null); var fileinfo = enumerator.next_file(null); while(fileinfo != null) {

Re: [Vala] why this new and innovative programming language called Vala?

2009-05-06 Thread Frederick Parotat
Another possibility could be the Seeress Vala . . from which the Völuspá came. . . . mixing past and future together ;-) . . . Seeress: an ancient mythological character, who's able to foresee. Language: Somehow innovativ idea and "new" programming language utilizing "ancient" C . . . or

Re: [Vala] why this new and innovative programming language called Vala?

2009-05-06 Thread Daniel Lucraft
> On Tue, 2009-05-05 at 21:37 +0100, Sam Liddicott wrote: >> Philip Van Hoof wrote: >> > Jürg has denied it, but we all know that secretly Jürg is a big fan and >> > stalker of Vala Mal Doran. >> > >> > Another reason is the French word voila. As in "Voila! That's how you do >> > it!" >> > >> > We'