[pygtk] Several issues with GTK
Neil Munro
neilmunro at gmail.com
Sun Feb 22 00:14:26 WST 2009
Hey all
I am currently writing an open source software update utility for
a university final year project using pygtk however being as it's the first
time I have used pygtk (or indeed any graphical application for that matter)
I'm experiencing some difficulties.I am using glade to actually build the
GUI and connecting signals up using autoconnect (don't know if that's of any
use, but I try to be as clear as possible, since I don't know what
information can be used to help others help me).
1) Not having much luck with gtk text views
I am aware I need to create a gtk text buffer object that is displayed in
the gtk text view, however I build my text buffer yet the text view does not
display it.
Here is the code I am using for the text view.
Preferences_Window = gtk.glade.XML( "warp-gui.glade", "Preferences"
)
print "Entering prefs text view function."
#for Feed in self.Feeds:
# print Feed
FeedView = Preferences_Window.get_widget( "TXTV_Feeds" )
FeedView_Buffer = gtk.TextBuffer( None )
FeedView.set_buffer( FeedView_Buffer )
data = ""
for Feed in self.Feeds:
data += Feed + "\n"
print data
FeedView_Buffer.insert_at_cursor(data,len(data))
2) I am having trouble with a dialog window, I have build one in glade, but
after setting signals for buttons and other interactive elements on the GUI
and connecting them in python, wondering if this was simply an idiosycrasity
of pygtk with dialog windows, I attempted to build a regular window, but I
couldn't even get the regular window to show.
Here is snippets from code for the dialog window I am using.
DirectInstall_Window = gtk.glade.XML( "warp-gui.glade",
"DirectInstall" )
Signals = { "on_DirectInstall_destroy" : self.Window_Destroyed,
"on_B_Apply_Clicked" : self.BTN_OK,
}
DirectInstall_Window.signal_autoconnect( Signals )
window = DirectInstall_Window.get_widget( "DirectInstall" )
window.run( )
window.destroy( )
def BTN_OK( self ):
print "OK Clicked."
def BTN_Close( self ):
print "Close clicked."
def Window_Destroyed( self, obj ):
print "Window closed." ## Window was closed. ##
3) Additionally I'm working with treeviews in listview mode and have
embedded widgets in cellrenderers(?) I think, the first of which is a check
button and I'm looking for a way of coding a means to allow the user to
interact with them and a means with which to get selected item in the list.
Even just pointers to tutorials and resources will help, though I do already
regularly check the python/pygtk documentation when I get stuck, I also have
a hard copy of the gnome 2 developers guide (although it's C specific it's
still useful) I woulnd't email this list without reading the obvious online
resources first.
So if anyone has any ideas that might help or any pointers I'd be really
grateful.
Many thanks
Neil Munro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20090221/21164108/attachment.htm
More information about the pygtk
mailing list