Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Latest commit

 

History

History
27 lines (26 loc) · 933 Bytes

gmyk.markdown

File metadata and controls

27 lines (26 loc) · 933 Bytes
author date layout slug status title wordpress_id
cbhl
2011-07-12 11:47:11
page
gmyk
publish
GMYK
1053

{% highlight python %} #!/usr/bin/env python import pygtk pygtk.require('2.0') import gtk import sys class GladeRunner: def gtk_main_quit(self, object): gtk.main_quit() return False def __init__(self): self.builder = gtk.Builder() self.builder.add_from_file(sys.argv[1]) self.window1 = self.builder.get_object("window1") self.builder.connect_signals(self) self.window1.show() def main(self): gtk.main() print __name__ if __name__ == "__main__": s = GladeRunner() s.main() {% endhighlight %} {% highlight cpp %} int main(int argc, char **argv) { Gtk::Main kit(argc, argv); Glib::RefPtrGtk::Builder\ refBuilder = Gtk::Builder::create_from_file("straights-gtk.glade"); refBuilder->get_widget("window1", window1); if (window1) { kit.run(*window1); } return 0; } {% endhighlight %}