Re: [pygtk] How to clear/delete all values from the gtk.Liststore

2011-12-13 Thread Zoltán Vörös

Hi,

self.builder.get_object('liststore_some_liststore').clear() should work. 
You can also do something like this:



model = self.builder.get_object('treeview_some_treeview').get_model()
model.clear()

if you just want to clear the list store linked to a treeview or whatever.
I hope this helps,

Zoltán

On 12/13/2011 04:14 PM, Arun p das wrote:

I am new to pygtk. currently i am doing one application using pygtk and glade.
my Question is How to clear/delete all values from the gtk.Liststore.
I am using the liststore as model for combobox.
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


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


Re: [pygtk] Using TreeView in PyGTK

2011-12-12 Thread Zoltán Vörös
Why don't you check out this example? 
http://zetcode.com/tutorials/pygtktutorial/advancedwidgets/

I hope this helps,
Zoltán

On 12/12/2011 07:39 PM, b...@b3ns.com wrote:

Hi,

I am figuring out the basics of PyGTK, and I am trying to get a 
ListView so I can display a list of usernames. I don't think I am 
doing it right and nothing is displayed when executing the PyGTK 
application. The code is below - thanks:


import gtk
import gobject

class PyGTKApp:
button = gtk.Button(Click Here!)
hBox = gtk.HBox()
hBox2 = gtk.HBox()
vBox = gtk.VBox()
def __init__(self):
self.window = gtk.Window()
self.treeView = gtk.TreeView()
self.listStore = gtk.ListStore(gobject.TYPE_STRING)
self.cellRenderer = gtk.CellRendererText()
self.treeViewColumn = gtk.TreeViewColumn(Users, 
self.cellRenderer, text=0)
self.appendC = 
self.treeViewColumn.add_attribute(self.cellRenderer, Bammurdo, 1)

self.window.set_title(PyGTK Application)
self.window.connect(destroy, gtk.main_quit)
self.window.set_size_request(400,100)
self.window.add(self.vBox)
self.vBox.pack_start(self.hBox,0)
self.vBox.pack_start(self.hBox2,0)
self.hBox.pack_start(gtk.HBox(),1,0)
self.hBox.pack_start(self.button,0,0)
self.hBox.pack_start(gtk.HBox(),1,0)
self.hBox2.pack_start(gtk.HBox(),1,0)
self.hBox2.pack_start(self.treeView)
self.hBox2.pack_start(gtk.HBox(),1,0)
self.window.show_all()
PyGTKApp()
gtk.main()

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


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


Re: [pygtk] PyGtk / Glade - how to get name of textEntry

2011-09-27 Thread Zoltán Vörös

But the earlier suggestion, namely, using

name = gtk.Buildable.get_name(widget)

should work. This will return the proper name from glade.
Zoltán
Thanks for tip Dieter, but I have tried gtk.Widget.get_name(widget) 
function, returns eg GtKEntry for a TextEntry field and GtkLabel for a 
label, ie the same as I get when using widget.get_name(). Code:


print j.get_name()
print gtk.Widget.get_name(j)

Both returns GtkEntry when run on a TextEntry.

I am after the name of the TextEntry as given in Glade, such as enTime 
or enDate.


Any ideas?

Regards



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


[pygtk] gtksourceview2 code folding

2011-08-21 Thread Zoltán Vörös

Hi All,

I would like to create a very primitive source editor based on pygtk, 
and I was wondering whether it is possible to fold the code using the 
gtksourceview widget. I have looked at the example code, and the 
(somewhat dated) documentation, but could not find anything suggesting 
that the python bindings could handle code folding. Any comments on this?

Cheers,
Zoltán
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/