Re: debugging some old glade.XML code, not getting a return of text?
- From: Jelle de Jong <jelledejong powercraft nl>
- To: glade-users-list gnome org
- Subject: Re: debugging some old glade.XML code, not getting a return of text?
- Date: Tue, 28 Jan 2020 19:12:21 +0100
Solution:
https://github.com/gisce/erpclient/commit/69b2c7de5c628c94d79881981dc34fad2023d2f9
and by adding the new includes libs as well.
On 2020-01-22 10:24, Jelle de Jong wrote:
Hello everybody,
Could somebody help me out please?
A code snippet of a piece of replacement code to popup a window to fill
in a question and have the answer stored as variable would be great.
I got the below piece of code, but it is not returning any text anymore
"entry.get_text()".
If I need to provide more information please let me know.
def ask(question, parent=None):
dia = glade.XML(terp_path('terp.glade'), 'win_quest',
gettext.textdomain())
win = dia.get_widget('win_quest')
label = dia.get_widget('label')
label.set_text(question)
entry = dia.get_widget('entry')
if not parent:
parent=service.LocalService('gui.main').window
win.set_transient_for(parent)
win.set_icon(TINYERP_ICON)
response = win.run()
print response
parent.present()
win.destroy()
if response == gtk.RESPONSE_CANCEL:
return None
else:
return entry.get_text()
Thank you,
Kind regards,
Jelle
On 2020-01-14 00:10, Jelle de Jong wrote:
Hello everybody,
I am debugging a piece of old python gtk code and found that the
bellow ask function using glade.XML to ask a question does not seem to
return the insert string entered into the generated dialog.
How can I change the bellow code to return the insert text string?
Kind regards,
Jelle de Jong
def ask(question, parent=None):
dia = glade.XML(terp_path('terp.glade'), 'win_quest',
gettext.textdomain())
win = dia.get_widget('win_quest')
label = dia.get_widget('label')
label.set_text(question)
entry = dia.get_widget('entry')
if not parent:
parent=service.LocalService('gui.main').window
win.set_transient_for(parent)
win.set_icon(TINYERP_ICON)
response = win.run()
print response
parent.present()
win.destroy()
#jelledj
name = entry.get_text()
print name
print "testing"
if response == gtk.RESPONSE_CANCEL:
return None
else:
return entry.get_text()
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]