[pygtk] put small images into a TextView border window

2003-10-30 Thread Pier Carteri
Hi to all,
can someone tell me how to put an image into the border window of a
gtkTextView? 
Any examples?

Thank you!
Best regards

Pier Carteri
-- 
Pier Carteri [EMAIL PROTECTED]

___
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] working with buttons and images...

2003-10-30 Thread Ivan Hernandez
hello. i had been working a little with pygtk, and i haven't found a way 
to make a pixmap scale to an arbitrary size.
i mean this... i have my button with an image, let's say...

image = gtk.Image()
image.set_from_file(apple-red.png)
image.show()
button = gtk.Button()
button.add(image)
button.show()
And i wanna make the image grow when the mouse is over... is this 
possible???
where can i found information on things like that? i have readed a 
tutorial but there is no more info.

thanks
ivan hernandez.
___
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] Re: A possible diagnose...

2003-10-30 Thread Gary Herron
On Thursday 30 October 2003 04:08 am, Christian Robottom Reis wrote:
 On Thu, Oct 30, 2003 at 09:15:52AM +, Alessandro Bottoni wrote:
  This morning I just tried to eliminate all pixmap from my Glade1
  projects. In particular I eliminated all stock pushbottons (that
  contains small icons) and all stock menu items (that contains small
  icons, as well).
 
  This clean up action fixed all the GTK and GDK -related troubles: no
  more crashes at start-up time, no more GTK/GDK assertion failed
  warnings at run time (when resizing the window).

 OH! I forgot this. You *can't* use stock icons in Glade if you're not
 calling gnome.app_init() in your application!

I read this somewhere, but that was after I got a glade-2 application
working with stock icons on both Linux and Windows, and all with no
call to gnome.app_init().

So, this doesn't appear to be necessary any more.

Gary Herron


___
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] Re: A possible diagnose...

2003-10-30 Thread Christian Robottom Reis
On Thu, Oct 30, 2003 at 08:13:27AM -0800, Gary Herron wrote:
 On Thursday 30 October 2003 04:08 am, Christian Robottom Reis wrote:
  On Thu, Oct 30, 2003 at 09:15:52AM +, Alessandro Bottoni wrote:
   This morning I just tried to eliminate all pixmap from my Glade1
   projects. In particular I eliminated all stock pushbottons (that
   contains small icons) and all stock menu items (that contains small
   icons, as well).
  
   This clean up action fixed all the GTK and GDK -related troubles: no
   more crashes at start-up time, no more GTK/GDK assertion failed
   warnings at run time (when resizing the window).
 
  OH! I forgot this. You *can't* use stock icons in Glade if you're not
  calling gnome.app_init() in your application!
 
 I read this somewhere, but that was after I got a glade-2 application
 working with stock icons on both Linux and Windows, and all with no
 call to gnome.app_init().
 
 So, this doesn't appear to be necessary any more.

Yeah, Alessandro is using GTK+ 1.2 with Kiwi. GTK+ 2.0 includes stock
icons [for buttons] without depending on Gnome.

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331
___
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] working with buttons and images...

2003-10-30 Thread Ivan Hernandez
Thanks You Gustavo! your info i helping me a lot and also is a good 
point to check having now the reference manual from

http://yang.inescn.pt/~gjc/pygtk2reference/ 

ivan hernandez

Gustavo J. A. M. Carneiro wrote:

A Qui, 2003-10-30 às 15:27, Ivan Hernandez escreveu:
 

hello. i had been working a little with pygtk, and i haven't found a way 
to make a pixmap scale to an arbitrary size.
i mean this... i have my button with an image, let's say...
   

 Very roughly, the solution is among these lines.  Look into
http://yang.inescn.pt/~gjc/pygtk2reference/ for more info.
pix_small = gtk.gdk.pixbuf_new_from_file(icon-small.png)
pix_large = gtk.gdk.pixbuf_new_from_file(icon-small.png)
image = gtk.Image()
image.set_from_pixbuf(pix_small)
image.show()

button = gtk.Button()
button.add(image)
button.show()
def button_enter(bt, ev):
bt.child.set_from_pixbuf(pix_large)
def button_enter(bt, ev):
bt.child.set_from_pixbuf(pix_small)
button.connect(enter-notify-event, button_enter)
button.connect(leave-notify-event, button_leave)
 That's it.  I could have misspelled some function names, be warned. 
Good luck.

 



___
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] working with buttons and images...

2003-10-30 Thread Gustavo J. A. M. Carneiro
A Qui, 2003-10-30 às 17:36, Ivan Hernandez escreveu:
 Thanks You Gustavo! your info i helping me a lot and also is a good 
 point to check having now the reference manual from
 
 http://yang.inescn.pt/~gjc/pygtk2reference/

  Oops, I pasted that link by mistake.  That is *not* the official pygtk
reference! :)

Please use this link instead:
http://www.moeraki.com/pygtkreference/pygtk2reference/index.html

Thanks!

 
 ivan hernandez
 
 Gustavo J. A. M. Carneiro wrote:
 
 A Qui, 2003-10-30 às 15:27, Ivan Hernandez escreveu:
   
 
 hello. i had been working a little with pygtk, and i haven't found a way 
 to make a pixmap scale to an arbitrary size.
 i mean this... i have my button with an image, let's say...
 
 
 
   Very roughly, the solution is among these lines.  Look into
 http://yang.inescn.pt/~gjc/pygtk2reference/ for more info.
 
 
 pix_small = gtk.gdk.pixbuf_new_from_file(icon-small.png)
 pix_large = gtk.gdk.pixbuf_new_from_file(icon-small.png)
 
 image = gtk.Image()
 image.set_from_pixbuf(pix_small)
 
 image.show()
 
 button = gtk.Button()
 button.add(image)
 button.show()
 
 def button_enter(bt, ev):
  bt.child.set_from_pixbuf(pix_large)
 def button_enter(bt, ev):
  bt.child.set_from_pixbuf(pix_small)
 
 button.connect(enter-notify-event, button_enter)
 button.connect(leave-notify-event, button_leave)
 
   That's it.  I could have misspelled some function names, be warned. 
 Good luck.
 
   
 
 
 
 ___
 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]


___
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/


Re: [pygtk] gtk.MessageDialog core

2003-10-30 Thread Gustavo J. A. M. Carneiro
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...

 
 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/
-- 
Gustavo J. A. M. Carneiro
[EMAIL PROTECTED] [EMAIL PROTECTED]

___
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 Christian Robottom Reis
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.

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331
___
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] help: how to build text from keypress and dead/compose keys ?

2003-10-30 Thread alejandro david weil
Hi!

 I hooked key_press event.. and all was ok until I wanted to 'handle' 
deadkeys .. well actually.. the deadkey event comes as a keypress.

 But I can't handle it, I could save it for later use.. but still don't know
how can I use that when other key comes.

 When a keypress comes I do:
1. check it's a keypress event
2. check if keyval  0xff00 == 0xff00, if it's that, - contrrol key
3. if not control key:
4.  oldstr = oldstr +  unichar(gtk.gdk.keyval_to_unicode( keyval ))

Well I must check that keyval_to_unicode doesn't return 0L.

But, is keyval_to_unicode the function that I should call? 

I saw that there are some gtk_im_context methods/classes.. 
are them for this kind of things? (i don't found information about
that functions)..

Is there some kind of value that I can keep, to process next keypress
with, in order to apply the char modification?

Thanks in advance!

-- 
+ There is no dark side of the moon really. Matter of fact it's all dark.


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