[pygtk] shrink property of gtk.Paned

2008-04-23 Thread Geoff Bache

Hi all,

Is there any way to set up gtk.Paned such that automatic shrinking on 
resize never occurs, but shrinking
by manually dragging the separator is still allowed? As far as I can see 
setting shrink=False prevents

both from occurring.

Regards,
Geoff Bache

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


Re: [pygtk] liststore (ComboBoxEntry) alignment (justify)

2008-04-23 Thread Andrea Caminiti


- Original Message 
From: Andrea Caminiti [EMAIL PROTECTED]
To: John Finlay [EMAIL PROTECTED]
Sent: Wednesday, April 23, 2008 9:16:24 AM
Subject: Re: [pygtk] liststore (ComboBoxEntry) alignment (justify)



Andrea Caminiti wrote:
 hi john:

 i was trying to use the code you just posted to to have a combobox with 
 images and it's labels (text), only, no text entry needed. but i got some 
 warnings.

 the code i used:

 def combo(self):
#lists = self.list
 combobox = gtk.ComboBox()
 list = gtk.ListStore(gtk.gdk.Pixbuf, str)
 px = gtk.CellRendererPixbuf()
 text = gtk.CellRendererText()
 combobox.pack_start(px, True)
 combobox.pack_start(text, True)
 combobox.add_attribute(px, pixbuf, 0)
 combobox.add_attribute(text, text, 1)
 combobox.pack_end(text, True)
   
you seem to be adding this twice. I think that's what the error message 
is about.

ok, but what am i adding twice? because i need to append 8 elements (image with 
a label/tag/text) at the combobox. and yes, right now i'm doing that task 8 
times. look:

pics = 
gtk.gdk.pixbuf_new_from_file('c:\\images\\bumps\\NE_to_SW_LowerTrace.jpg')#dicts.images['b1'])
list.append((pics, 'fking shit'))#dicts.names['b1'])
pics = 
gtk.gdk.pixbuf_new_from_file('c:\\images\\bumps\\NE_to_SW_UpperTrace.jpg')#dicts.images['b1'])
list.append((pics, 'fking shit'))#dicts.names['b1'])
pics = 
gtk.gdk.pixbuf_new_from_file('c:\\images\\bumps\\NW_to_SE_LowerTrace.jpg')#dicts.images['b1'])
list.append((pics, 'fking shit'))#dicts.names['b1'])
pics = 
gtk.gdk.pixbuf_new_from_file('c:\\images\\bumps\\NW_to_SE_UpperTrace.jpg')#dicts.images['b1'])
list.append((pics, 'fking shit'))#dicts.names['b1'])
pics = 
gtk.gdk.pixbuf_new_from_file('c:\\images\\bumps\\SE_to_NW_LowerTrace.jpg')#dicts.images['b1'])
list.append((pics, 'fking shit'))#dicts.names['b1'])
pics = 
gtk.gdk.pixbuf_new_from_file('c:\\images\\bumps\\SE_to_NW_UpperTrace.jpg')#dicts.images['b1'])
list.append((pics, 'fking shit'))#dicts.names['b1'])
pics = 
gtk.gdk.pixbuf_new_from_file('c:\\images\\bumps\\SW_to_NE_LowerTrace.jpg')#dicts.images['b1'])
list.append((pics, 'fking shit'))#dicts.names['b1'])
pics = 
gtk.gdk.pixbuf_new_from_file('c:\\images\\bumps\\SW_to_NE_UpperTrace.jpg')#dicts.images['b1'])
list.append((pics, 'fking shit'))#dicts.names['b1'])

#combobox.set_use_arrows_always(True)
#list
combobox.set_model(list)
#combobox.connect('changed', self.changed_cb)
combobox.set_active(0)
return combobox

Sorry for the bad language. i was tired off trying to make it work my way and 
not the right way.

 #for n in range (8):
 #numb =+ 1
 pics = 
 gtk.gdk.pixbuf_new_from_file('c:\\images\\bumps\\NE_to_SW_LowerTrace.jpg')#dicts.images['b1'])
 list.append((pics, 'fucking shit'))#dicts.names['b1'])

 python warnings:

 dgc-gui.py:71: GtkWarning: gtk_cell_view_cell_layout_pack_end: assertion 
 `!gtk_c
 ell_view_get_cell_info (cellview, renderer)' failed
   combobox.pack_end(text, True)
 dgc-gui.py:71: GtkWarning: gtk_tree_view_column_cell_layout_pack_end: 
 assertion
 `! gtk_tree_view_column_get_cell_info (column, cell)' failed
   combobox.pack_end(text, True)
 dgc-gui.py:94: GtkWarning: gtk_cell_view_cell_layout_pack_end: assertion 
 `!gtk_c
 ell_view_get_cell_info (cellview, renderer)' failed
   combobox.set_model(list)
 dgc-gui.py:278: GtkWarning: gtk_tree_view_column_cell_layout_pack_end: 
 assertion
  `! gtk_tree_view_column_get_cell_info (column, cell)' failed
   window.show()

 and on the other hand. as you can see, i was trying to use a dictionary in a 
 class to get the name and path for the images. but seem that doesn't work. 
 is there any way to do it?? or i need to write down each path and label for 
 each image...
   
What was the error message when you tried this, if any?

yes that are the messages i got when tried it.

nrayever





  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ





  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

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


Re: [pygtk] Getting widget visibility

2008-04-23 Thread Mitko Haralanov
On Tue, 22 Apr 2008 21:31:35 -0700
John Finlay [EMAIL PROTECTED] wrote:

 It does inherit the visible property - what makes you think it doesn't?

The exception that my app threw when I tried to use it:

Traceback (most recent call last):
  File /monitor/track.py, line 131, in start_updates
if syslog_frame.visible:
AttributeError: 'gtk.Frame' object has no attribute 'visible'


-- 
Mitko Haralanov
==
Usage: fortune -P [] -a [xsz] [Q: [file]] [rKe9] -v6[+] dataspec ...
inputdir
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Getting widget visibility

2008-04-23 Thread Facundo Batista
2008/4/23, Mitko Haralanov [EMAIL PROTECTED]:

 The exception that my app threw when I tried to use it:

  Traceback (most recent call last):
   File /monitor/track.py, line 131, in start_updates
 if syslog_frame.visible:
  AttributeError: 'gtk.Frame' object has no attribute 'visible'

If you could provide an example that makes this to you, for us to try
it, we could help you better.

The smaller the example is, the better for all.

Regards,

-- 
.Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Getting widget visibility

2008-04-23 Thread John Ehresman

Mitko Haralanov wrote:

On Tue, 22 Apr 2008 21:31:35 -0700
John Finlay [EMAIL PROTECTED] wrote:


It does inherit the visible property - what makes you think it doesn't?


The exception that my app threw when I tried to use it:

Traceback (most recent call last):
  File /monitor/track.py, line 131, in start_updates
if syslog_frame.visible:
AttributeError: 'gtk.Frame' object has no attribute 'visible'


Try
  syslog_frame.props.visible

gobject properties are not automatically attributes for a variety of 
reasons.  This is documented at 
http://pygtk.org/docs/pygobject/class-gobject.html


John
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Getting widget visibility

2008-04-23 Thread Mitko Haralanov
On Wed, 23 Apr 2008 14:10:10 -0300
Facundo Batista [EMAIL PROTECTED] wrote:

 If you could provide an example that makes this to you, for us to try
 it, we could help you better.

Here you go:
#!/usr/bin/python
import gtk
import pygtk

def toggle_func (widget, *user_data):
frame = user_data[0]
if frame.visible:
frame.hide ()
else:
frame.show ()

window = gtk.Window ()
vbox = gtk.VBox ()
button = gtk.Button (Toggle)

frame = gtk.Frame (Test Frame)
label = gtk.Label (Some Text)

frame.add (label)
vbox.pack_start (frame)
vbox.pack_start (button)

window.add (vbox)
button.connect (clicked, toggle_func, frame)
window.connect (delete-event, gtk.main_quit)
window.show_all ()
gtk.main ()

# ./test.py
Traceback (most recent call last):
  File ./test.py, line 8, in toggle_func
if frame.visible:
AttributeError: 'gtk.Frame' object has no attribute 'visible'

-- 
Mitko Haralanov
==
I WILL NOT USE ABBREV.
I WILL NOT USE ABBREV.
I WILL NOT USE ABBREV.
I WILL NOT USE ABBREV.

Bart Simpson on chalkboard in episode 2F33
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Getting widget visibility

2008-04-23 Thread Mitko Haralanov
On Wed, 23 Apr 2008 13:23:22 -0400
John Ehresman [EMAIL PROTECTED] wrote:

 Try
syslog_frame.props.visible

That worked. Thank you.

-- 
Mitko Haralanov
==
43. If I knew it wasn't going to work, I would have tested it sooner.

--Top 100 things you don't want the sysadmin to say
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] liststore (ComboBoxEntry) alignment (justify)

2008-04-23 Thread John Finlay

Andrea Caminiti wrote:

- Original Message 
From: Andrea Caminiti [EMAIL PROTECTED]
To: John Finlay [EMAIL PROTECTED]
Sent: Wednesday, April 23, 2008 9:16:24 AM
Subject: Re: [pygtk] liststore (ComboBoxEntry) alignment (justify)



  

Andrea Caminiti wrote:


hi john:

i was trying to use the code you just posted to to have a combobox with images 
and it's labels (text), only, no text entry needed. but i got some warnings.

the code i used:

def combo(self):
   #lists = self.list
combobox = gtk.ComboBox()
list = gtk.ListStore(gtk.gdk.Pixbuf, str)
px = gtk.CellRendererPixbuf()
text = gtk.CellRendererText()
combobox.pack_start(px, True)
combobox.pack_start(text, True)
combobox.add_attribute(px, pixbuf, 0)
combobox.add_attribute(text, text, 1)
combobox.pack_end(text, True)
  
  
you seem to be adding this twice. I think that's what the error message 


is about.

  
You are adding the cellrenderertext text to the combobox twice - once 
in the pack_start and once in the pack_end. You can only add it once. 
Remove the line containing pack_end.


John
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] liststore (ComboBoxEntry) alignment (justify)

2008-04-23 Thread Andrea Caminiti
Thanks a lot, now it's ok, 0 warnings!

- Original Message 
From: John Finlay [EMAIL PROTECTED]
To: Andrea Caminiti [EMAIL PROTECTED]
Cc: pygtk@daa.com.au
Sent: Wednesday, April 23, 2008 1:27:23 PM
Subject: Re: [pygtk] liststore (ComboBoxEntry) alignment (justify)

Andrea Caminiti wrote:
 - Original Message 
 From: Andrea Caminiti [EMAIL PROTECTED]
 To: John Finlay [EMAIL PROTECTED]
 Sent: Wednesday, April 23, 2008 9:16:24 AM
 Subject: Re: [pygtk] liststore (ComboBoxEntry) alignment (justify)



   
 Andrea Caminiti wrote:
 
 hi john:

 i was trying to use the code you just posted to to have a combobox with 
 images and it's labels (text), only, no text entry needed. but i got some 
 warnings.

 the code i used:

 def combo(self):
#lists = self.list
 combobox = gtk.ComboBox()
 list = gtk.ListStore(gtk.gdk.Pixbuf, str)
 px = gtk.CellRendererPixbuf()
 text = gtk.CellRendererText()
 combobox.pack_start(px, True)
 combobox.pack_start(text, True)
 combobox.add_attribute(px, pixbuf, 0)
 combobox.add_attribute(text, text, 1)
 combobox.pack_end(text, True)
   
   
 you seem to be adding this twice. I think that's what the error message 
 
 is about.

   
You are adding the cellrenderertext text to the combobox twice - once 
in the pack_start and once in the pack_end. You can only add it once. 
Remove the line containing pack_end.

John





  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

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


Re: [pygtk] shrink property of gtk.Paned

2008-04-23 Thread John Finlay

Geoff Bache wrote:

Hi all,

Is there any way to set up gtk.Paned such that automatic shrinking on 
resize never occurs, but shrinking
by manually dragging the separator is still allowed? As far as I can 
see setting shrink=False prevents

both from occurring.
If I understand your situation the default behavior should do this i.e. 
pane1 should have resize=False and pane2, resize=True which should allow 
resizing to apply all additional space to pane2 and none to pane1. A 
short example would help.


John
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/