LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-07-2008, 10:17 PM   #1
mongoosecage
Member
 
Registered: Jun 2008
Distribution: Slackware 13.0, Ubuntu 9.10, Windows XP Pro SP3
Posts: 100

Rep: Reputation: 15
I have a conflict with following a tutorial about using Glade to work with PyGTK noob


I am an entirely Python newbie. I have only completed Chapters 1,2,3, and 4 of the Python Tutorial by Guido http://docs.python.org/tut/.

Now I am attempting to create a Graphical User Interface using Glade through this tutorial http://www.learningpython.com/2006/0...gtk-and-glade/.

I have gotten through the entire GUI designing bit and I saved it. But, according to the tutorial I should have two files produced. One saved as .glade and the other .gladep. I only get one file that is of .glade extension. I did attempt to create a .py document with it. Which contains:
Code:
#!/usr/bin/env python

import sys
try:
 	import pygtk
  	pygtk.require("2.0")
except:
  	pass
try:
	import gtk
  	import gtk.glade
except:
	sys.exit(1)

class HellowWorldGTK:
	"""This is an Hello World GTK application"""

	def __init__(self):
		
		#Set the Glade file
		self.gladefile = "pyhelloworld.glade"  
	        self.wTree = gtk.glade.XML(self.gladefile) 
		
		#Get the Main Window, and connect the "destroy" event
		self.window = self.wTree.get_widget("MainWindow")
		if (self.window):
			self.window.connect("destroy", gtk.main_quit)
According to the tutorial this is the code required to get the GUI started. I have made it executable using chmod +x but when I run it I get nothing. I also ran it through terminal and the terminal brefiely appears for a fraction of a second and vanishes.

I believe its because i don't have a .gladep file.

note: I noticed that I had 'frame' instead of window in my glade application possible version problem?

Though this is on Ubuntu and I ran the
Code:
apt-get install python-gtk2 python-glade2
to check if I had it and it confirmed I had these so I don't understand why some sort of version confusion would be there.

As well as, http://www.kplug.org/glade_tutorial/...uick_tour.html states that I need two files.
 
Old 07-08-2008, 06:53 AM   #2
mongoosecage
Member
 
Registered: Jun 2008
Distribution: Slackware 13.0, Ubuntu 9.10, Windows XP Pro SP3
Posts: 100

Original Poster
Rep: Reputation: 15
bump? Not really in a hurry, Just some random guesses would help me out.
 
Old 07-09-2008, 12:18 AM   #3
mongoosecage
Member
 
Registered: Jun 2008
Distribution: Slackware 13.0, Ubuntu 9.10, Windows XP Pro SP3
Posts: 100

Original Poster
Rep: Reputation: 15
stupid...

ok, I figured it, not quite, but I believe the one that I was using on my Ubunut machine sucked and was somehow different. I tried it on slackware, and my, it looks beautiful. Very neat when compared to the Ubuntu one. I suppose that's why no one had a good explanation.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GLADE to PyGTK LinuxNoob75 Programming 2 12-26-2007 04:58 PM
How to get usb ports 2 work, hardware conflict Nem Slackware 12 03-17-2007 02:11 PM
ProFTPd - Too noob for tutorial? Waerner Linux - Networking 4 01-01-2006 08:09 AM
how to work in glade maia_1 Programming 1 08-08-2004 01:20 AM
Glade Tutorial rch Programming 1 05-24-2003 06:43 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration