Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.