0

I'm building simple PyGTK app using Glade UI designer.

I followed pattern from default Ubuntu app, where preferences and about dialog are implemented extending gtk.Dialog, so I added new dialog with similar code (2 classes).

I added new dialog, but I want new dialog to be my custom SaveProjectRepositoryNotifierDialog which is extended from gtk.Dialog. I can't find how to set class name in Glade for my dialog?

So I changed it manually.

Before:

<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <requires lib="gtk+" version="2.16"/>
  <!-- interface-requires preferences_repository_notifier_dialog 1.0 -->
  <!-- interface-naming-policy project-wide -->
  <object class="GtkDialog" id="save_project_dialog">
    <property name="can_focus">False</property>
    <property name="border_width">5</property>
...

after:

<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <requires lib="gtk+" version="2.16"/>
  <!-- interface-requires preferences_repository_notifier_dialog 1.0 -->
  <!-- interface-naming-policy project-wide -->
  <object class="SaveProjectRepositoryNotifierDialog" id="save_project_dialog">
    <property name="can_focus">False</property>
    <property name="border_width">5</property>
..

But after that change dialog is empty in Glade and I can't add child widgets to it!

enter image description here

How can I make custom dialog with Glade? Is there a way to set class for dialog from Glade or there is another way around?

1 Answer 1

0

It looks like you need to define a catalog so that glade can find your custom widget:

http://www.pygtk.org/articles/custom-widgets-glade/Custom_PyGTK_Widgets_in_Glade3.html http://developer.gnome.org/gladeui/3.6/catalogintro.html

Thanks,

James

2
  • Thanks, this helped. Signals does not work yet, but i guess I'll figure that out.
    – umpirsky
    Dec 9, 2011 at 18:42
  • Ah, for some reason button works with click signl, not activate?
    – umpirsky
    Dec 9, 2011 at 22:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .