Re: [pygtk] problem appending data to Clist using libglade

2000-09-06 Thread Hugo Varotto


Awsome !  Thanks !   That definitely worked, as I said, I'm pretty new to
Python.

Regards,

Hugo



James Henstridge wrote:

>
> The append method takes a sequence of strings as its argument.  So, pass
> in ['blah'] rather than 'blah'.  'blah' looks like a sequence of one
> character strings (it is equivalent to ['b', 'l', 'a', 'h']).
>
> James.
>
> --
> Email: [EMAIL PROTECTED]
> WWW:   http://www.daa.com.au/~james/
>
> ___
> pygtk mailing list   [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] problem appending data to Clist using libglade

2000-09-06 Thread James Henstridge

On Wed, 6 Sep 2000, Hugo Varotto wrote:

> 
> Hi to all,
> 
> while writing a small program in Python using GTK and libglade, I found
> a strange behaviour with CLists created with libglade. If I try to
> append data to a clist, no matter what string I put in the "append"
> instruction, the clist only shows up the first lettter of the string.
> I'm very puzzled at this, and I'm no sure if I should initialize
> beforehand the width of the clist column or whatever.
> 
> I've attached a very small Python program that will load a very small
> .glade XML file and attemt to add ( append ) some data to it. In my
> machine at least it shows only the first letter 9 for all the rows ).
> I'm also attaching the .glade file ( hope I'm not breaking any mailing
> list rule by attaching these text files ). I'll apreciate if somebody
> could take a look at them to see what's wrong.
> 
> Now the usual stuff: I'm running RedHat 6.2, python is 1.5 and the
> versions of PyGTK is 0.6.6, pygnome is 1.0.53 and libglade is 0.14
> ( I believe the latest ones distributed by Helixcode GNOME ).
> 
> I'm fairly new to the Python and libglade world ( 3 days ago I haven't
> even tried to start python neither using libglade ), so it might be very
> possible that I'm doing something very wrong.
> 
> Thanks in advance,

The append method takes a sequence of strings as its argument.  So, pass
in ['blah'] rather than 'blah'.  'blah' looks like a sequence of one
character strings (it is equivalent to ['b', 'l', 'a', 'h']).

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



[pygtk] problem appending data to Clist using libglade

2000-09-06 Thread Hugo Varotto


Hi to all,

while writing a small program in Python using GTK and libglade, I found
a strange behaviour with CLists created with libglade. If I try to
append data to a clist, no matter what string I put in the "append"
instruction, the clist only shows up the first lettter of the string.
I'm very puzzled at this, and I'm no sure if I should initialize
beforehand the width of the clist column or whatever.

I've attached a very small Python program that will load a very small
.glade XML file and attemt to add ( append ) some data to it. In my
machine at least it shows only the first letter 9 for all the rows ).
I'm also attaching the .glade file ( hope I'm not breaking any mailing
list rule by attaching these text files ). I'll apreciate if somebody
could take a look at them to see what's wrong.

Now the usual stuff: I'm running RedHat 6.2, python is 1.5 and the
versions of PyGTK is 0.6.6, pygnome is 1.0.53 and libglade is 0.14
( I believe the latest ones distributed by Helixcode GNOME ).

I'm fairly new to the Python and libglade world ( 3 days ago I haven't
even tried to start python neither using libglade ), so it might be very
possible that I'm doing something very wrong.

Thanks in advance,

Hugo





import sys
import os

sys.argv=[]
sys.argv.append("null")

from gtk import *
from gnome.ui import *
from GDK import *
import libglade


widgets = libglade.GladeXML( 'filetab.glade')

filetab = widgets.get_widget('filetab')
dirtree = widgets.get_widget('dirtree')
filelist = widgets.get_widget('filelist')


window1 = widgets.get_widget('window1')
window1.connect('delete_event', mainquit )

filelist.append( "1test7")
filelist.append( "2test7")
filelist.append( "3test7")
filelist.append( "4test7")
filelist.append( "5test7")
filelist.append( "6test7")
filelist.append( "7test7")
filetab.set_usize(200, 500)

mainloop()






Title: window1




  filetab
  filetab
  
  src
  pixmaps
  C
  True
  True



  GtkWindow
  window1
  
  GTK_WINDOW_TOPLEVEL
  GTK_WIN_POS_NONE
  False
  False
  True
  False

  
GtkVBox
filetab
False
0


  GtkVBox
  vbox2
  4
  False
  0
  
	0
	False
	True
  

  
	GtkLabel
	label4
	Filter
	GTK_JUSTIFY_CENTER
	False
	0
	0.5
	0
	0
	
	  0
	  False
	  False
	
  

  
	GtkCombo
	filter
	False
	True
	False
	True
	False
	
	
	  0
	  False
	  False
	

	
	  GtkEntry
	  GtkCombo:entry
	  filter-entry
	  True
	  True
	  True
	  0
	  
	
  



  GtkVPaned
  vpaned1
  4
  6
  6
  129
  
	0
	True
	True
  

  
	GtkVBox
	vbox1
	False
	0
	
	  True
	  False
	

	
	  GtkScrolledWindow
	  scrolledwindow2
	  GTK_POLICY_AUTOMATIC
	  GTK_POLICY_ALWAYS
	  GTK_UPDATE_CONTINUOUS
	  GTK_UPDATE_CONTINUOUS
	  
	0
	True
	True
	  

	  
	GtkCList
	filelist
	True
	1
	80
	GTK_SELECTION_SINGLE
	True
	GTK_SHADOW_IN

	
	  GtkLabel
	  CList:title
	  label3
	  File
	  GTK_JUSTIFY_CENTER
	  False
	  0.5
	  0.5
	  0
	  0
	
	  
	
  

  
	GtkScrolledWindow
	scrolledwindow1
	GTK_POLICY_AUTOMATIC
	GTK_POLICY_ALWAYS
	GTK_UPDATE_CONTINUOUS
	GTK_UPDATE_CONTINUOUS
	
	  True
	  True
	

	
	  GtkCTree
	  dirtree
	  True
	  1
	  80
	  GTK_SELECTION_SINGLE
	  True
	  GTK_SHADOW_IN

	  
	GtkLabel
	CTree:title
	label1
	Directory
	GTK_JUSTIFY_CENTER
	False
	0.5
	0.5
	0
	0