Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 17 Dec 2014, 21:07
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
genie enter & display gtk
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message

Joined: 19 Jul 2010
Posts: 2

PostPosted: 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
View user's profile Send_private_message 

Joined: 19 Jul 2010
Posts: 2

PostPosted: Sun 08 Aug 2010, 02:10    Post_subject:  

I tried this and got this error.



entry : Gtk.Entry
label : Gtk.Label

a:string = entry.get_text

def static on_button_clicked ()

label.set_text( a )
Gtk.init (ref args)

var window = new Gtk.Window (Gtk.WindowType.TOPLEVEL)
window.set_default_size (400, 50)
window.destroy += Gtk.main_quit
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 ()
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
View user's profile Send_private_message 

Joined: 18 May 2008
Posts: 4423

PostPosted: Sun 08 Aug 2010, 11:52    Post_subject:  


here are examples:

Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 

Joined: 04 Dec 2008
Posts: 1462
Location: North Lincolnshire. UK

PostPosted: 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.
The moment after you press "Post" is the moment you actually see the typso Cool
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot attach files in this forum
You can download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0424s ][ Queries: 11 (0.0036s) ][ GZIP on ]