Re: [pygtk] gtk.MessageDialog core

2003-11-03 Thread Fernando San Martin W.
On Fri, 31 Oct 2003 11:58:12 +, Gustavo J. A. M. Carneiro wrote

i report the bug to bugzilla.gnome.org, so they told this:

+
+--- Additional Comments From [EMAIL PROTECTED]  2003-11-03 11:45 ---
+Maybe pygtk is not getting the return value from the signal
+handler right? I'd need a C test case before I'd even want
+to start considering this one further. 

i ask it again, should by a pygtk problem?, i can fix it yet and my app.
doesn't work well...

 Well, it's gtk+/C's fault, not pygtk's.  It seems that gtk+ 
 doesn't like when you connect to focus-out-event and run a nested 
 main loop inside the handler (dialog.run).  The GtkEntry widget 
 expects to receive the event soon.
 
   Maybe you should bring this up in the gtk list, or file bug report 
 in bugzilla.
 
   In the mean time, as a workaround, you could dialog.show() and 
 make it modal, but return False from the handler as soon as 
 possible.  Also, notice that 2 identical dialogs are created when 
 you press F1.  You have to prevent that somehow.
 
   Regards.
 
 A Sex, 2003-10-31 às 11:43, Fernando San Martin W. escreveu:
  On Fri, 31 Oct 2003 07:37:52 -0400, Fernando San Martin W. wrote
   i try this:
   
   import gobject
   import gtk
   
   from gtk import TRUE, FALSE
   
   def mainwin():
 
 
 def advice():
 m = unicode(Atención, 'latin-1')
 
 dialog  = gtk.MessageDialog(w, gtk.DIALOG_MODAL |
   gtk.DIALOG_DESTROY_WITH_PARENT,gtk.MESSAGE_INFO, gtk.BUTTONS_OK,
   m.encode('utf-8'))
 
 dialog.run()
 dialog.destroy()
   
 def on_entry_key_press_cb(entry, event):
 if event.keyval == gtk.keysyms.F1:
 advice()
   
 def on_entry_focus_out_cb(entry, event):
 advice()
 
 return FALSE
 
 w = gtk.Window()
 w.connect('destroy', lambda w: gtk.main_quit())
 w.set_title('Core Test')
 
 v = gtk.VBox()
 
 w.add(v)
 
 e = gtk.Entry()
 
 e.add_events(gtk.gdk.KEY_PRESS_MASK)
 e.connect('key-press-event', on_entry_key_press_cb)
 e.connect('focus-out-event', on_entry_focus_out_cb)
 
 v.pack_start(e)
 
 b = gtk.Button(Quit)
 
 v.pack_start(b)
 
 
 w.show_all()
   
   mainwin()
   gtk.mainloop()
   
   when the entry widget lost_focus, the messagebox it's showed, but 
   after little delay all crash...
   
  The problem is in the focus out event, i get this out from stdout:
  
  python -u test.py
  sys:1: DeprecationWarning: Non-ASCII character '\xf3' in file test.py on line
  11, but no encoding declared; see http://www.python.org/peps/pep-0263.html for
  details
  
  (test.py:2786): Gtk-WARNING **: GtkEntry - did not receive
focus-out-event. If you
  connect a handler to this signal, it must return
  FALSE so the entry gets the event as well
  
  Gtk-ERROR **: file ../../gtk/gtkentry.c: line 4338 (blink_cb): assertion
  failed: (GTK_WIDGET_HAS_FOCUS (entry))
  aborting...
  Exit code: 0 Signal: 6
  
  so i don't know what should be that.
  
  thanks
  
  Fernando San Martín Woernercounter.li.org
  Jefe Departamento Informática  #216550
  Galilea S.A.   Talca
  2 Norte 965 - Fono/Fax: 56-71-224876   Chile
  
  Soy dueño de las palabras que guardo, y prisionero de las que digo.
  
  ___
  pygtk mailing list   [EMAIL PROTECTED]
  http://www.daa.com.au/mailman/listinfo/pygtk
  Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
 -- 
 Gustavo João Alves Marques Carneiro
 [EMAIL PROTECTED] [EMAIL PROTECTED]


Fernando San Martín Woernercounter.li.org
Jefe Departamento Informática  #216550
Galilea S.A.   Talca
2 Norte 965 - Fono/Fax: 56-71-224876   Chile

Soy dueño de las palabras que guardo, y prisionero de las que digo.

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] gtk.MessageDialog core

2003-10-31 Thread Fernando San Martin W.
On Thu, 30 Oct 2003 21:22:13 -0200, Christian Robottom Reis wrote
 On Thu, Oct 30, 2003 at 03:40:11PM -0400, Fernando San Martin W. wrote:
  i tested in some diferents machines and i have the same problem, this code is
  executed by key_press_event on an gtk.entry to advice if something is wrong
  with the data entered in the entry
 
 Can you try to produce a minimal testcase so we can reproduce the
 problem? Makes it a lot easier to verify and fix if it's a bug in the
 current release.

i try this:

import gobject
import gtk

from gtk import TRUE, FALSE


def mainwin():


def advice():
m = unicode(Atención, 'latin-1')

dialog  = gtk.MessageDialog(w, gtk.DIALOG_MODAL |
gtk.DIALOG_DESTROY_WITH_PARENT,gtk.MESSAGE_INFO, gtk.BUTTONS_OK,
m.encode('utf-8'))

dialog.run()
dialog.destroy()


def on_entry_key_press_cb(entry, event):
if event.keyval == gtk.keysyms.F1:
advice()

def on_entry_focus_out_cb(entry, event):
advice()

return FALSE

w = gtk.Window()
w.connect('destroy', lambda w: gtk.main_quit())
w.set_title('Core Test')

v = gtk.VBox()

w.add(v)

e = gtk.Entry()

e.add_events(gtk.gdk.KEY_PRESS_MASK)
e.connect('key-press-event', on_entry_key_press_cb)
e.connect('focus-out-event', on_entry_focus_out_cb)

v.pack_start(e)

b = gtk.Button(Quit)

v.pack_start(b)


w.show_all()

mainwin()
gtk.mainloop()

when the entry widget lost_focus, the messagebox it's showed, but after little
delay all crash...

take care


Fernando San Martín Woernercounter.li.org
Jefe Departamento Informática  #216550
Galilea S.A.   Talca
2 Norte 965 - Fono/Fax: 56-71-224876   Chile

Soy dueño de las palabras que guardo, y prisionero de las que digo.

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] gtk.MessageDialog core

2003-10-31 Thread Fernando San Martin W.
On Fri, 31 Oct 2003 07:37:52 -0400, Fernando San Martin W. wrote
 i try this:
 
 import gobject
 import gtk
 
 from gtk import TRUE, FALSE
 
 def mainwin():
   
   
   def advice():
   m = unicode(Atención, 'latin-1')
   
   dialog  = gtk.MessageDialog(w, gtk.DIALOG_MODAL |
 gtk.DIALOG_DESTROY_WITH_PARENT,gtk.MESSAGE_INFO, gtk.BUTTONS_OK,
 m.encode('utf-8'))
   
   dialog.run()
   dialog.destroy()
 
   def on_entry_key_press_cb(entry, event):
   if event.keyval == gtk.keysyms.F1:
   advice()
 
   def on_entry_focus_out_cb(entry, event):
   advice()
   
   return FALSE
   
   w = gtk.Window()
   w.connect('destroy', lambda w: gtk.main_quit())
   w.set_title('Core Test')
   
   v = gtk.VBox()
   
   w.add(v)
   
   e = gtk.Entry()
   
   e.add_events(gtk.gdk.KEY_PRESS_MASK)
   e.connect('key-press-event', on_entry_key_press_cb)
   e.connect('focus-out-event', on_entry_focus_out_cb)
   
   v.pack_start(e)
   
   b = gtk.Button(Quit)
   
   v.pack_start(b)
   
   
   w.show_all()
 
 mainwin()
 gtk.mainloop()
 
 when the entry widget lost_focus, the messagebox it's showed, but 
 after little delay all crash...
 
The problem is in the focus out event, i get this out from stdout:

python -u test.py
sys:1: DeprecationWarning: Non-ASCII character '\xf3' in file test.py on line
11, but no encoding declared; see http://www.python.org/peps/pep-0263.html for
details

(test.py:2786): Gtk-WARNING **: GtkEntry - did not receive focus-out-event. If you
connect a handler to this signal, it must return
FALSE so the entry gets the event as well

Gtk-ERROR **: file ../../gtk/gtkentry.c: line 4338 (blink_cb): assertion
failed: (GTK_WIDGET_HAS_FOCUS (entry))
aborting...
Exit code: 0 Signal: 6

so i don't know what should be that.

thanks

Fernando San Martín Woernercounter.li.org
Jefe Departamento Informática  #216550
Galilea S.A.   Talca
2 Norte 965 - Fono/Fax: 56-71-224876   Chile

Soy dueño de las palabras que guardo, y prisionero de las que digo.

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] gtk.MessageDialog core

2003-10-30 Thread Fernando San Martin W.
hello:

i'm runnig this code:

m = unicode(mensaje, 'latin-1')

dialog = gtk.MessageDialog(window, gtk.DIALOG_MODAL |
gtk.DIALOG_DESTROY_WITH_PARENT,gtk.MESSAGE_INFO, gtk.BUTTONS_OK,
m.encode('utf-8'))

dialog.run()
dialog.destroy()

the message dialog is displayed ok, but when i move the mouse my application
crash and i get a core dumped from python, the tracebak displayed is this:

(Gestor.py:2402): Gtk-WARNING **: ../../gtk/gtkwidget.c:2781: widget
`GtkEntry' has no activatable signal key_press_event without arguments

(Gestor.py:2402): Gtk-WARNING **: ../../gtk/gtkwidget.c:2781: widget
`GtkEntry' has no activatable signal key_press_event without arguments

(Gestor.py:2402): Gtk-WARNING **: ../../gtk/gtkwidget.c:2781: widget
`GtkEntry' has no activatable signal key_press_event without arguments

(Gestor.py:2402): Gtk-WARNING **: ../../gtk/gtkwidget.c:2781: widget
`GtkEntry' has no activatable signal key_press_event without arguments

(Gestor.py:2402): Gtk-WARNING **: ../../gtk/gtkwidget.c:2781: widget
`GtkEntry' has no activatable signal key_press_event without arguments

(Gestor.py:2402): Gtk-WARNING **: ../../gtk/gtkwidget.c:2781: widget
`GtkEntry' has no activatable signal key_press_event without arguments

(Gestor.py:2402): Gtk-WARNING **: GtkEntry - did not receive focus-out-event.
If you
connect a handler to this signal, it must return
FALSE so the entry gets the event as well

Gtk-ERROR **: file ../../gtk/gtkentry.c: line 4338 (blink_cb): assertion
failed: (GTK_WIDGET_HAS_FOCUS (entry))
aborting...
Exit code: 0 Signal:6


any idea about this?

i'm using 

pygtk2.0-devel-2.0.0-2mdk
pygtk2.0-libglade-2.0.0-2mdk
pygtk2.0-glarea-2.0.0-2mdk
pygtk2.0-wrapper-2.0.0-2mdk 
pygtk2.0-2.0.0-2mdk 

gnome-python-nautilus-2.0.0-2mdk
gnome-python-gnomevfs-2.0.0-2mdk
gnome-python-gnomeprint-2.0.0-2mdk
gnome-python-2.0.0-2mdk
gnome-python-applet-2.0.0-2mdk
gnome-python-gconf-2.0.0-2mdk
gnome-python-bonobo-2.0.0-2mdk
gnome-python-gtkhtml2-2.0.0-2mdk
gnome-python-canvas-2.0.0-2mdk

in mandrake cooker, 9.2 beta


thanks in advance

Fernando San Martín Woernercounter.li.org
Jefe Departamento Informática  #216550
Galilea S.A.   Talca
2 Norte 965 - Fono/Fax: 56-71-224876   Chile

Soy dueño de las palabras que guardo, y prisionero de las que digo.

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] gtk.MessageDialog core

2003-10-30 Thread Fernando San Martin W.
On Thu, 30 Oct 2003 19:13:48 +, Gustavo J. A. M. Carneiro wrote
 A Qui, 2003-10-30 às 18:30, Fernando San Martin W. escreveu:
  hello:
  
  i'm runnig this code:
  
  m = unicode(mensaje, 'latin-1')
  
  dialog = gtk.MessageDialog(window, gtk.DIALOG_MODAL |
  gtk.DIALOG_DESTROY_WITH_PARENT,gtk.MESSAGE_INFO, gtk.BUTTONS_OK,
  m.encode('utf-8'))
  
  dialog.run()
  dialog.destroy()
 
   I tried running this code, except that I replaced 'window' for 
 None, since I don't have a parent window to test with.  It ran 
 without any problems.  Could be a problem with your pygtk 
 installation, perhaps...

i tested in some diferents machines and i have the same problem, this code is
executed by key_press_event on an gtk.entry to advice if something is wrong
with the data entered in the entry

the call is like this

def on_txtFolioComprobante_key_press_event(self, entry, event):
if event.keyval == gtk.keysyms.F1:
...   
  self.aviso(self.padre.ctb_frm_main,sys.exc_info()[1])
  return


def aviso(self, window, mensaje):
una simple caja para avisar cosillas

m = unicode(mensaje, 'latin-1')

dialog = gtk.MessageDialog(window, gtk.DIALOG_MODAL |
gtk.DIALOG_DESTROY_WITH_PARENT,gtk.MESSAGE_INFO, gtk.BUTTONS_OK,
m.encode('utf-8'))

dialog.run()
dialog.destroy()


Fernando San Martín Woernercounter.li.org
Jefe Departamento Informática  #216550
Galilea S.A.   Talca
2 Norte 965 - Fono/Fax: 56-71-224876   Chile

Soy dueño de las palabras que guardo, y prisionero de las que digo.

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] DateEdit Problem

2003-09-24 Thread Fernando San Martin W.

i'm trying to show a dateedit widget without time using this:

gnome.ui.DateEdit(mktime(t), gtk.FALSE, gtk.TRUE)

but doesn't works, the widget show de time section anyway

some tips?, what's wrong?



Fernando San Martín Woernercounter.li.org
Jefe Departamento Informática  #216550
Galilea S.A.   Talca
2 Norte 965 - Fono/Fax: 56-71-224876   Chile

Soy dueño de las palabras que guardo, y prisionero de las que digo.

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] HTML Widget

2003-09-17 Thread Fernando San Martin W.
Hi all, may be it's a newbie question, but is there some html widget?, i need
to show html documents on my app..., some tips?

thanks in advance

Fernando San Martín Woernercounter.li.org
Jefe Departamento Informática  #216550
Galilea S.A.   Talca
2 Norte 965 - Fono/Fax: 56-71-224876   Chile

Soy dueño de las palabras que guardo, y prisionero de las que digo.

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/