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



----- 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]