[Vala] Program doesn't quit
For the past year or so off and on I've been working on a pet project. Between the time spent rewriting various parts of it over and over, and trying to learn Vala/GTK, it's taking me a lot longer than I hoped it would. Anyway, here is my project on Github: https://github.com/steveno/balistica While I'm sure there are plenty of improvements that can be made (patches welcome!) I have one problem that's been driving me crazy for a while now and I'm desperate for help now to solve it. I assume the problem has to be in src/BalisticaApplication.vala or src/MainWindow.vala. If anyone is willing to offer any suggestions I'd greatly appreciate it! Steven N. Oliver ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] Program doesn't quit
Hi, I don't know gtk.application / window very well, but are you supposed to run the main loop manually even when using gtkapplication? What happens if you remove Gtk.main call at line 58 of https://github.com/steveno/balistica/blob/master/src/MainWindow.vala Ciao, Andrea Il 03/dic/2013 19:33 Steven Oliver oliver.ste...@gmail.com ha scritto: For the past year or so off and on I've been working on a pet project. Between the time spent rewriting various parts of it over and over, and trying to learn Vala/GTK, it's taking me a lot longer than I hoped it would. Anyway, here is my project on Github: https://github.com/steveno/balistica While I'm sure there are plenty of improvements that can be made (patches welcome!) I have one problem that's been driving me crazy for a while now and I'm desperate for help now to solve it. I assume the problem has to be in src/BalisticaApplication.vala or src/MainWindow.vala. If anyone is willing to offer any suggestions I'd greatly appreciate it! Steven N. Oliver ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] Program doesn't quit
On Tue, 2013-12-03 at 13:31 -0500, Steven Oliver wrote: For the past year or so off and on I've been working on a pet project. Between the time spent rewriting various parts of it over and over, and trying to learn Vala/GTK, it's taking me a lot longer than I hoped it would. Anyway, here is my project on Github: https://github.com/steveno/balistica While I'm sure there are plenty of improvements that can be made (patches welcome!) I have one problem that's been driving me crazy for a while now and I'm desperate for help now to solve it. I assume the problem has to be in src/BalisticaApplication.vala or src/MainWindow.vala. If anyone is willing to offer any suggestions I'd greatly appreciate it! You didn't really describe the symptoms (in fact, you didn't even mention what the problem was in the body of your e-mail), but it's probably a safe guess that you're not calling Gtk.main_quit(). https://wiki.gnome.org/Projects/Vala/GTKSample has some examples. For the simple cases, people generally just connect it to the main window's destroy signal: window.destroy.connect (Gtk.main_quit); Once you invoke Gtk.main_quit(), your program will resume execution by returning from the Gtk.main() call. -Evan signature.asc Description: This is a digitally signed message part ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] Program doesn't quit
Evan, My apologies for apparently not clearly stating the issue. Here's try number 2: 1) Run the program. 2) Close the GUI that pops up 3) The GUI goes away as expected but the process is still running in my terminal As for you suggestion, I already have that line in my code. Line 54 of MainWindow.vala. Andrea, Good guess! I hadn't actually tried that one. That didn't fix it though :( I'm now left with the process still there but now with the following error message: (balistica:2473): Gtk-CRITICAL **: gtk_main_quit: assertion `main_loops != NULL' failed Steven N. Oliver On Tue, Dec 3, 2013 at 2:22 PM, Evan Nemerson e...@coeus-group.com wrote: On Tue, 2013-12-03 at 13:31 -0500, Steven Oliver wrote: For the past year or so off and on I've been working on a pet project. Between the time spent rewriting various parts of it over and over, and trying to learn Vala/GTK, it's taking me a lot longer than I hoped it would. Anyway, here is my project on Github: https://github.com/steveno/balistica While I'm sure there are plenty of improvements that can be made (patches welcome!) I have one problem that's been driving me crazy for a while now and I'm desperate for help now to solve it. I assume the problem has to be in src/BalisticaApplication.vala or src/MainWindow.vala. If anyone is willing to offer any suggestions I'd greatly appreciate it! You didn't really describe the symptoms (in fact, you didn't even mention what the problem was in the body of your e-mail), but it's probably a safe guess that you're not calling Gtk.main_quit(). https://wiki.gnome.org/Projects/Vala/GTKSample has some examples. For the simple cases, people generally just connect it to the main window's destroy signal: window.destroy.connect (Gtk.main_quit); Once you invoke Gtk.main_quit(), your program will resume execution by returning from the Gtk.main() call. -Evan ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] Program doesn't quit
As a quick fix, you could replace the gtk_main_quit function with another function that has the same signature, but contains the exit method, which will be sure to bump you out of the program. Just be sure to declare the exit method in your file. extern void exit(int exit_code); void quit() { exit(0); } On 12/3/2013 5:24 PM, Steven Oliver wrote: Evan, My apologies for apparently not clearly stating the issue. Here's try number 2: 1) Run the program. 2) Close the GUI that pops up 3) The GUI goes away as expected but the process is still running in my terminal As for you suggestion, I already have that line in my code. Line 54 of MainWindow.vala. Andrea, Good guess! I hadn't actually tried that one. That didn't fix it though :( I'm now left with the process still there but now with the following error message: (balistica:2473): Gtk-CRITICAL **: gtk_main_quit: assertion `main_loops != NULL' failed Steven N. Oliver On Tue, Dec 3, 2013 at 2:22 PM, Evan Nemerson e...@coeus-group.com wrote: On Tue, 2013-12-03 at 13:31 -0500, Steven Oliver wrote: For the past year or so off and on I've been working on a pet project. Between the time spent rewriting various parts of it over and over, and trying to learn Vala/GTK, it's taking me a lot longer than I hoped it would. Anyway, here is my project on Github: https://github.com/steveno/balistica While I'm sure there are plenty of improvements that can be made (patches welcome!) I have one problem that's been driving me crazy for a while now and I'm desperate for help now to solve it. I assume the problem has to be in src/BalisticaApplication.vala or src/MainWindow.vala. If anyone is willing to offer any suggestions I'd greatly appreciate it! You didn't really describe the symptoms (in fact, you didn't even mention what the problem was in the body of your e-mail), but it's probably a safe guess that you're not calling Gtk.main_quit(). https://wiki.gnome.org/Projects/Vala/GTKSample has some examples. For the simple cases, people generally just connect it to the main window's destroy signal: window.destroy.connect (Gtk.main_quit); Once you invoke Gtk.main_quit(), your program will resume execution by returning from the Gtk.main() call. -Evan ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] Program doesn't quit
I figured out my own issue. Well, sort of anyway. In order to fix it I removed the MainWindow class that overrode Gtk.Window. I moved the code that would have been there back to my BalisticaApplication class. Now it works. https://github.com/steveno/balistica/commit/0a11c5e1610acce2a7294b2865ec115caac31261 Steven N. Oliver On Tue, Dec 3, 2013 at 5:31 PM, Andrew Benton andrew.benton...@gmail.comwrote: As a quick fix, you could replace the gtk_main_quit function with another function that has the same signature, but contains the exit method, which will be sure to bump you out of the program. Just be sure to declare the exit method in your file. extern void exit(int exit_code); void quit() { exit(0); } On 12/3/2013 5:24 PM, Steven Oliver wrote: Evan, My apologies for apparently not clearly stating the issue. Here's try number 2: 1) Run the program. 2) Close the GUI that pops up 3) The GUI goes away as expected but the process is still running in my terminal As for you suggestion, I already have that line in my code. Line 54 of MainWindow.vala. Andrea, Good guess! I hadn't actually tried that one. That didn't fix it though :( I'm now left with the process still there but now with the following error message: (balistica:2473): Gtk-CRITICAL **: gtk_main_quit: assertion `main_loops != NULL' failed Steven N. Oliver On Tue, Dec 3, 2013 at 2:22 PM, Evan Nemerson e...@coeus-group.com wrote: On Tue, 2013-12-03 at 13:31 -0500, Steven Oliver wrote: For the past year or so off and on I've been working on a pet project. Between the time spent rewriting various parts of it over and over, and trying to learn Vala/GTK, it's taking me a lot longer than I hoped it would. Anyway, here is my project on Github: https://github.com/steveno/balistica While I'm sure there are plenty of improvements that can be made (patches welcome!) I have one problem that's been driving me crazy for a while now and I'm desperate for help now to solve it. I assume the problem has to be in src/BalisticaApplication.vala or src/MainWindow.vala. If anyone is willing to offer any suggestions I'd greatly appreciate it! You didn't really describe the symptoms (in fact, you didn't even mention what the problem was in the body of your e-mail), but it's probably a safe guess that you're not calling Gtk.main_quit(). https://wiki.gnome.org/Projects/Vala/GTKSample has some examples. For the simple cases, people generally just connect it to the main window's destroy signal: window.destroy.connect (Gtk.main_quit); Once you invoke Gtk.main_quit(), your program will resume execution by returning from the Gtk.main() call. -Evan ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] vala libgda LINQ
2013/12/3 Juarez Rudsatz juar...@gmail.com I checked the samples and some parts of the code. Nice work. :-) Regarding language support, it seems to remain a good amount of work to be done yet. Do you mean Vala features right? I'm counting the language features that will be necessary: - Object serialization Are you mean write some where. For XML serialization we have Vala's GXml project[1]. On GXml's serialization branch, you'll find my work on GObject serialization to XML, comparable with .NET but, I think more flexible[2]. - Anonymous types - Expression and type introspection - Type aliasing... - Syntax changes At the end a Collection have objects with a set of properties, a SELECT expression is a filter of that set of objects and a set of properties. They could be stored in a DbRecord (as for libgda's GdaData [3] ) to save memory and adding something like Methods_With_Syntax_Support [4] , Vala compiler could transform: var selection = select name, salary from employees where id = 123; stdout.printf (@$(selection.name) / $(selection.salary)); to: var _tmp_ = new ArrayListEmployee (); _tmp_.add_all ( ((Traversable) employees).filter( (g)={ return id.equals (g) true : false; }); var selection = ((Selectable) _tmp_).get_fields (name, salary); if (selection.size != 1) throw new SelectableError.MULTIPLE_VALUES_TO_SINGLE (...); var _tmp2_ = selection[0].get_field(name); var _tmp3_ = selection[0].get_field(salary); stdout.printf (@$(_tmp2_) / $(_tmp3_)); What level of support you are planning? Because I haven't used LINQ before, I don't know most of its features. Just think about to allow: a) Use a SQL like syntax to filter objects and properties, by adding support to Vala compiler to generate corresponding Vala or C code b) Object collection must implement at least Gee.Collection and its items must be Gee.Comparable and Selectable c) Add a Selectable interface to Gee to allow introspect objects properties and create a Collection with desired DbRecord set of values. I don't think mimic LINQ is correct. May we can do better, but is necessary to define use cases. The only one I have in mind is: a) select {list-of-fields} from {collection-object} where {condition} For this simple expression Vala's compiler should generate required code to: a) Check for collection-object is a GObject implementing Gee.Collection and its elements must be Gee.Comparable and Selectable b) Check for list-of-fields are public properties in collection-object c) Check for condition is using collection-object 's public properties d) Generate a PredicateG delegate function to find object required objects e) Fill a Gee.Collection with filtered objects f) Generate a Gee.Collection from Selectable, that produce rows and values/columns (with name=properties' name) It would be well received by upstream developers? Really don't know. I'm CC to Vala and Gee lists to hear them about this idea. I'm planning a new architecture for ouro next applications and considering vala. But the type safety and language support are the strengths of linq we really appreciate. I'm planning to help someway, but I have a long way yet to be produtive. Regards Juarez [1] https://git.gnome.org/browse/gxml [2] https://git.gnome.org/browse/gxml/log/?h=serialization [3] https://git.gnome.org/browse/libgda/tree/libgda/data [4] https://wiki.gnome.org/Projects/Vala/Tutorial#Methods_With_Syntax_Support Em 03/12/2013 16:35, Daniel Espinosa eso...@gmail.com escreveu: You can see a preview of my work on current stable libgda. I've finished interfaces and implementations under GdaData name space. I've added some documentation just use --enable-vala-extensions --gtk-doc (some other switches are required) to see it installed. Missed Selectable interface or implementation. I would like to add syntax support on Vala compiler in order to have LINQ like one. For now is very easy to access to data using GdaData objects, see unit tests for more examples. El dic 3, 2013 10:03 a.m., Juarez Rudsatz juar...@gmail.com escribió: Hi, I found that you have been working in a possible implementation of LINQ in vala [1]. I see that you have made good progress regarding this support. I want to know what is the current status. What's missing yet? How is the work for getting basic support ? Regards Juarez [1] https://mail.gnome.org/archives/vala-list/2011-December/msg00140.html -- Trabajar, la mejor arma para tu superación de grano en grano, se hace la arena (R) (en trámite, pero para los cuates: LIBRE) ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list