Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How do I programatically edit label widget in the runtime , I am using quickly

I tried

self.title=builder.get_object("title") 

for initialising and

def update_Label(self,url):
    self.title.set_text(newlabel) 

For updating the label ,But it won't work

!.Honestly I dont know what I am doing . I am an absolute beginner in python

share|improve this question
    
Gtk.Label.set_text(str) is the correct way, so please add some sample code and a full traceback. –  Timo Jul 3 '12 at 10:50
    
@Timo I updated my question –  Tachyons Jul 3 '12 at 11:01
    
What is the traceback (error) you receive? Is self.title a Gtk.Label? Is newlabel defined in your namespace? –  Timo Jul 3 '12 at 11:13

1 Answer 1

up vote 1 down vote accepted

Looks like a typo:

def update_Label(self,url):
    self.title.set_text(newlabel) 

to

def update_Label(self,url):
    self.title.set_text(url) 
share|improve this answer
    
Sorry I already fixed it , It was a typo of the previous command –  Tachyons Jul 4 '12 at 1:09
    
Newlabel was a temporary string for test the method –  Tachyons Jul 4 '12 at 1:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.