|
|
2009-12-27
, 08:12
|
|
|
Posts: 4,707 |
Thanked: 4,643 times |
Joined on Oct 2007
@ Bulgaria
|
#2
|
#!/usr/bin/env python
# First run tutorial.glade through gtk-builder-convert with this command:
# gtk-builder-convert tutorial.glade tutorial.xml
# Then save this file as tutorial.py and make it executable using this command:
# chmod a+x tutorial.py
# And execute it:
# ./tutorial.py
import pygtk
pygtk.require("2.0")
import gtk
class TutorialApp(object):
def __init__(self):
builder = gtk.Builder()
builder.add_from_file("tutorial.xml")
builder.connect_signals({ "on_window_destroy" : gtk.main_quit })
self.window = builder.get_object("window")
self.window.show()
if __name__ == "__main__":
app = TutorialApp()
gtk.main()
| The Following User Says Thank You to Bundyo For This Useful Post: | ||
|
|
2009-12-29
, 13:05
|
|
Posts: 308 |
Thanked: 62 times |
Joined on Jun 2009
@ Turkiye
|
#3
|

:/
|
|
2009-12-29
, 17:43
|
|
|
Posts: 4,707 |
Thanked: 4,643 times |
Joined on Oct 2007
@ Bulgaria
|
#4
|
| The Following User Says Thank You to Bundyo For This Useful Post: | ||
|
|
2009-12-30
, 11:06
|
|
Posts: 308 |
Thanked: 62 times |
Joined on Jun 2009
@ Turkiye
|
#5
|
the version of my glade is 3.6.6 and i started with gtkbuilder not libglade
then when i save it, it is automatically naming it as *.glade
should i rename it to xml manually by myself??
| The Following User Says Thank You to McLightning For This Useful Post: | ||
|
|
2010-01-07
, 12:42
|
|
Posts: 308 |
Thanked: 62 times |
Joined on Jun 2009
@ Turkiye
|
#6
|
i want to design some widgets with glade
but i dunno how to import them into this code:
import gtk import hildondesktop import os class DesktopApplet(hildondesktop.HomeItem): def Button_clicked(self, Widget, Data = None): os.spawnlp(os.P_NOWAIT, "maemo-invoker", "maemo-invoker", "osso-xterm.launch") def __init__(self): hildondesktop.HomeItem.__init__(self) Button = gtk.Button() Image = gtk.image_new_from_file("/usr/share/icons/hicolor/64x64/apps/terminal.png") Button.set_image(Image) Button.connect("clicked", self.Button_clicked) Button.show() self.add(Button) def hd_plugin_get_objects(): plugin = DesktopApplet() return [plugin]Mplayer Full ShortCut List
http://www.keyxl.com/aaa2fa5/302/MPl...-shortcuts.htm
Mclightning.com
DegCal - Right Triangle Degree Calculator