The time now is Sun 22 Apr 2018, 22:27
All times are UTC - 4 |
Author |
Message |
JohnM34
Joined: 19 Jul 2010 Posts: 2
|
Posted: Mon 19 Jul 2010, 06:13 Post subject:
genie enter & display gtk |
|
I am trying to learn Genie in Puppy Linux 431 and would like to know if there are any examples on how to use entry and label in gtk to enter, save and display data like strings and integers.
Any help is greatly appreciated
|
Back to top
|
|
 |
JohnM34
Joined: 19 Jul 2010 Posts: 2
|
Posted: Sun 08 Aug 2010, 02:10 Post subject:
|
|
I tried this and got this error.
[indent=4]
uses
GLib
entry : Gtk.Entry
label : Gtk.Label
a:string = entry.get_text
def static on_button_clicked ()
label.set_text( a )
init
Gtk.init (ref args)
var window = new Gtk.Window (Gtk.WindowType.TOPLEVEL)
window.set_default_size (400, 50)
window.destroy += Gtk.main_quit
window.set_title("Input")
window.move(100 , 100)
var vbox = new Gtk.VBox(false , 1)
vbox.border_width = 10
vbox.spacing = 10
window.add (vbox)
entry = new Gtk.Entry ()
entry.set_editable(true)
vbox.pack_start (entry, false, true, 0)
var button = new Gtk.Button.with_label("OK")
vbox.pack_start (button, false, true, 0)
label = new Gtk.Label (" ")
vbox.pack_start (label, false, true, 0)
button.clicked += on_button_clicked;
window.show_all ()
Gtk.main ()
# valac --pkg gtk+-2.0 entrytst4_2_1.gs -o entrytst4_2_1
entrytst4_2_1.gs:9.2-9.9: error: Non-constant field initializers not supported in this context
a:string = entry.get_text
^^^^^^^^
Compilation failed: 1 error(s), 0 warning(s)
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 4786 Location: Kingwood, TX
|
Posted: Sun 08 Aug 2010, 11:52 Post subject:
|
|
Uses
Glib
Gtk
here are examples:
http://code.valaide.org/category/tags/genie
_________________ Check out my github repositories. I may eventually get around to updating my blogspot.
|
Back to top
|
|
 |
tasmod

Joined: 04 Dec 2008 Posts: 1462 Location: North Lincolnshire. UK
|
Posted: Sun 08 Aug 2010, 14:23 Post subject:
|
|
Don't know anything about the code style above (Genie?) but in gtk get_entry_text is a const char, that's what your error message appears to say. Can't help further, I'm struggling with gtk.
_________________ Rob
-
The moment after you press "Post" is the moment you actually see the typso 
|
Back to top
|
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|