Re: [Vala] Genie: Gtk.Entry in Gtk.Dialog



Thank you very much! Your help has helped me solve it and now I can
continue.

I am writing the code with Genie (+ Sqlite + Gtk) to make a basic
contact agenda, just with the intention of practicing to learn.

The project is progressing well, but sometimes I block things like this,
and thanks to people like you I can continue learning.

When the project is more advanced I will share it here to know your
suggestions for improvement.

Thank you.


El 08/02/17 a las 20:31, Al Thomas escribió:
----- Original Message -----
From: "webierta gmail com" <webierta gmail com>
Sent: Wednesday, 8 February 2017, 17:48
Subject: [Vala] Genie: Gtk.Entry in Gtk.Dialog
I'm going crazy trying to get the text from a Gtk: Entry in a Gtk.Dialog.
class Dialogo: Gtk.Dialog
    entrada_nombre: Gtk.Entry  
  
    def crea_dialogo ()

        entrada_nombre: Gtk.Entry = new Gtk.Entry()
I think that last line should just be:

entrada_nombre = new Gtk.Entry()

You have already declared the variable in the scope of the
class itself. By declaring another variable of the same name
in the crea_dialogo method you have a new variable, but in 

the scope of only the method. Whether you use:
var entrada_nombre = new Gtk.Entry()
or
entrada_nombre:Gtk.Entry = new Gtk.Entry()

both are declaring a new variable because you are specifying 

the type, either explicitly or by inference.

Al



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