Re: [Vala] Any tips for newbies



   > On Wednesday, 19 September 2018, 09:57:22 BST, Robin Wils via vala-list <vala-list gnome org> wrote: > I 
am working on a [small simple project](https://gitlab.com/RobinWils/BAG-art-creator/tree/master) and have a 
feeling that the GNOME Vala
website only contains some basics. One of my issues is that I haven't found a way to recreate a object.

Making a clear distinction between Vala, the language, and using Vala for developing a GTK+ application is 
important. It sounds like you are looking for more information on developing with GTK+. By the way, in the 
Vala language creating an object is instantiating a class, like this:

void main () {
    new MyObject ();
}

class MyObject {}

If you want to create another instance just use new MyObject() again.

I use a grid which I want to be able to resize when a menu_button gets clicked so I probably need a way to 
recreate/refresh the grid.

You might want to look at GtkFlowBox, which was introduced with GTK+ 3.12: 
https://valadoc.org/gtk+-3.0/Gtk.FlowBox.html
I was wondering of there are any other useful sites or tips for new Vala users. I am probably already doing 
some
bad practises in that project since I am new to the Vala language.

The GNOME game Five-or-More has a Vala port that was finished as part of Google Summer of Code: 
https://gitlab.gnome.org/GNOME/five-or-more/merge_requests/1
There are a number of GTK+ tools that can be started from the command line:
gtk3-demo - useful to see the widgets available, although the code demos are in C
gtk3-widget-factory - another demo of widgets
gtk3-icon-browser - shows available icons

Elementary OS's Sudoku may also be of interest: https://github.com/parnold-x/sudoku
StackOverflow, https://stackoverflow.com/questions/tagged/vala , is also used for asking questions about GTK+ 
and Vala. Take a look at some of the very good answers there. If you're asking a question then include a 
simple working example showing the problem.

All the best,

Al



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]