Re: [Vala] Genie: Gtk.Entry in Gtk.Dialog
- From: Al Thomas <astavale yahoo co uk>
- To: "webierta gmail com" <webierta gmail com>, "vala-list gnome org" <vala-list gnome org>
- Subject: Re: [Vala] Genie: Gtk.Entry in Gtk.Dialog
- Date: Wed, 8 Feb 2017 19:31:19 +0000 (UTC)
----- 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]