Questions tagged [genie]

Genie is a programming language allowing one to program in Vala with a Python-like syntax.

Genie is a programming language allowing one to program in Vala with a Python-like syntax.

93 questions
0
votes
1 answer

How would a switch interface look in Genie?

I am trying to add a dialog to a small application with genie. It is an openfile dialog that should open upon clicking in a headerbar button. Examples are lacking in Genie, so I am now trying to adapt something from vala. However, all examples that…
lf_araujo
  • 1,991
  • 2
  • 16
  • 39
0
votes
1 answer

Exit with error code from init block in Genie

In Vala, I can write the following code: int main(string[] args) { if (args[1] == "secret") { return 0; } else { return 1; } } How would I do the same in Genie? The following does not work: init if args[1] ==…
Roland Illig
  • 40,703
  • 10
  • 88
  • 121
0
votes
1 answer

Make a Gtk.Scale have the same value as a Gtk.Spin

My objective is to make the slider in the scale be in sync with the value in the spin and vice-versa. I've tried some alternatives, but I am not finding a way of getting the value where the scale is so that I can set the new spin position. The…
lf_araujo
  • 1,991
  • 2
  • 16
  • 39
0
votes
1 answer

Can't rename file because: g_file_set_display_name: assertion 'G_IS_FILE (file)' failed

This is part of an exercise. And I couldn't find a similar question at SO. Here is a little GTK program, where after clicking the Rename button the file should be renamed. Although the uri seems to be pointing to the correct file, for some reason I…
lf_araujo
  • 1,991
  • 2
  • 16
  • 39
0
votes
1 answer

Genie's writeonly property

I read it from vala tutorial for readonly: vala public int b { get; private set; } in Genie: prop readonly b: int for writeonly: Vala: public int b { private get; set; } Genie: [this line: syntax error] prop writeonly b: int How to declare an…
Zee
  • 78
  • 6
0
votes
1 answer

Classes in Genie

I am trying to replicate the Verbal Expression library for python in Genie as an exercise to learn how to use classes. I've got simple classes like the ones listed at the tutorial down, however when it comes to instatiate methods in a object…
lf_araujo
  • 1,991
  • 2
  • 16
  • 39
0
votes
1 answer

class construct for genie

the code will output 1 2 2 the 1 only print once. I have no idea, how to write it in genie. below is vala code: public static void main() { var a = new One(); var b = new One(); } class One : Object { class construct { …
Zee
  • 78
  • 6
0
votes
1 answer

How to use Sqlite.Callback in Genie

While trying to solve the question How to print a sqlite table content with genie programming language I found out that I could try to call PrintSingleRecipe as a callback from Database.exec. However, it seems that a callback cannot be a regular…
lf_araujo
  • 1,991
  • 2
  • 16
  • 39
0
votes
1 answer

How to print a sqlite table content with genie programming language

Based on previous questions here I managed to create the dataset, print all recipes listed and now I am trying to pick one of the recipes from that list and show its Title, Instructions and Ingredients. The instructions are mapped to the Recipes via…
lf_araujo
  • 1,991
  • 2
  • 16
  • 39
0
votes
1 answer

Printing the results from a select query with Genie

I have created the database in SQL lite and improved the little program to handle it (list, add, remove records). At this point I am trying to list the contents from the database using the prepared statement step() function. However, I can't iterate…
lf_araujo
  • 1,991
  • 2
  • 16
  • 39
0
votes
2 answers

How to INSERT information into a Sqlite database using Genie Programming Language?

This question is a spin off a previous question here in which a database was created. However, when it comes to add information to that dataset I can go manually adding information or going via a programmatically way. The latter is my choice for a…
lf_araujo
  • 1,991
  • 2
  • 16
  • 39
0
votes
1 answer

How to call GNU ReadLine in Genie

I know the stdin.read_line() function, but I wanted to make my code less verbose via the use or something more in line to raw_input() in python. So I found out about GNU ReadLine in this discussion about vala, however I can`t reproduce it in…
lf_araujo
  • 1,991
  • 2
  • 16
  • 39
0
votes
3 answers

Vala/Genie builds for Win/Mac?

Is the Vala/Genie compiler available on the Windows and Mac OS X platforms? I know that it is possible to use GLib and GTK on Windows and Mac OS X, but there are no official downloads of Vala for either platform.
user2102508
  • 1,009
  • 11
  • 23
0
votes
1 answer

Genie howto repeat a string N times as an string array

I write this code, repeatc for repeat char to char array. it works. repeats for repeat string N times to an string array. but repeat string to string array core dumped. A, A, A, AB, AB, AB, *** Error in `./untitled': free(): invalid pointer:…
Naam Famas
  • 124
  • 7
0
votes
2 answers

GLIb Array sort, how to sort?

I've tried to do some sorting with GLib's GenericArray, Slist, List. Sorting with sort_with_data works as expected, but when I've tried Glib's Array it doesn't work, or rather it does something different! This is my sort function for…
Naam Famas
  • 124
  • 7