Where can I find GladeGen?

I would like to create a GUI using Glade and generate Python code. The fact is that I can not find GladeGen. Does anyone know where to download it?

+3
source share
4 answers

Why not use a GUI constructor, it's something like Anjuta or Glade, write it in glade XML and use the python bindings for libglade to use the XML file ... Like XAML.

Edit, added some links to Glade.xml-> python

http://glc.sourceforge.net/
http://www.pygtk.org/ (may help)

+2
source
+2
0

, :

launchpad.net/~wattazoum: gladegen: : Python

(direct tarball - )

, GladeGen:

, Glade 3.8.0 Libglade GtkBuilder; , , Libglade; GladeGen :

$ python2.7 GladeGen.py /tmp/test-libglade.glade TestMe TestMe
funcs
main <function main at 0xb72d98b4>
search_file <function search_file at 0xb72d964c>

classes
GladeWindow <class 'GladeWindow.GladeWindow'>
TestMe <class 'TestMe.TestMe'>

methods
('GladeWindow', '__init__')
('GladeWindow', 'hide')
('GladeWindow', 'set_callback_function')
('GladeWindow', 'set_search_path')
('GladeWindow', 'set_top_window')
('GladeWindow', 'show')
('TestMe', '__init__')
('TestMe', 'hide')
('TestMe', 'init')
('TestMe', 'set_callback_function')
('TestMe', 'set_search_path')
('TestMe', 'set_top_window')
('TestMe', 'show')

widgets
('GtkWindow', 'window1')
('GtkHBox', 'hbox1')
('GtkScrolledWindow', 'scrolledwindow1')

handlers

$ python2.7 GladeGen.py /tmp/test-gtkbuilder.glade TestMe2 TestMe2
funcs
main <function main at 0x95778ec>
search_file <function search_file at 0x9577684>

classes
GladeWindow <class 'GladeWindow.GladeWindow'>
TestMe2 <class 'TestMe2.TestMe2'>

methods
('GladeWindow', '__init__')
('GladeWindow', 'hide')
('GladeWindow', 'set_callback_function')
('GladeWindow', 'set_search_path')
('GladeWindow', 'set_top_window')
('GladeWindow', 'show')
('TestMe2', '__init__')
('TestMe2', 'hide')
('TestMe2', 'init')
('TestMe2', 'set_callback_function')
('TestMe2', 'set_search_path')
('TestMe2', 'set_top_window')
('TestMe2', 'show')

widgets

handlers

, python, (python TestMe.py); , gtkbuilder , :

$ python2.7 TestMe2.py

(TestMe2.py:24883): libglade-WARNING **: Expected <glade-interface>.  Got <interface>.

(TestMe2.py:24883): libglade-WARNING **: did not finish in PARSER_FINISH state
Traceback (most recent call last):
  File "TestMe2.py", line 66, in <module>
    main(sys.argv)
  File "TestMe2.py", line 59, in main
    w = TestMe2()
  File "TestMe2.py", line 37, in __init__
    self.init()
  File "TestMe2.py", line 52, in init
    GladeWindow.__init__(self, filename, top_window, widget_list, handlers)
  File "/path/to/src/wattazoum_pydevtools_gladegen/src/GladeWindow.py", line 77, in __init__
    self.xml = gtk.glade.XML(fname)
RuntimeError: could not create GladeXML object

, , , , -, Glade /// - Python...


... EDIT: , :

def init(self):
  filename = '/tmp/test-libglade.glade'
  widget_list = [
          'window1',
          'hbox1',
          'scrolledwindow1',
          ]
  handlers = [
          ]
  top_window = 'window1'
  GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

... glade ( http://www.pygtk.org/articles/pygtk-glade-gui/Creating_a_GUI_using_PyGTK_and_Glade.htm), Python, , , :

self.window1 = gtk.Window(gtk.WINDOW_TOPLEVEL)

... ..... , :)

0

Source: https://habr.com/ru/post/1709914/


All Articles