Re: [gtkmm] libglademm to create an is_a relationship



Thomas Muldowney <temas box5 net> writes:

> I hope this isn't often asked here, searches of the list didn't turn it
> up, so... Has anyone devised a way to use libglademm to create an is_a
> relationship from a widget defined in a glade file?  We have a partially
> working solution using just regular libglade, but it feels hackish and
> incomplete.  Any ones thoughts or comments would be helpful.

I haven't, but why do you want to do it?

For windows, I usually just do something like (which I think is much
simpler):

  class PreferencesWindow: public SigC::Object, noncopyable
  {
  public:
    PreferencesWindow();
    ~PreferencesWindow();

    void raise();
    void show();

    // ... other public methods, usually not many are needed

  private:
    Glib::RefPtr<Gnome::Glade::Xml> ui;

    Gtk::Window *window;
    // ... other widget pointers extracted from the XML 

    // ... other call backs

    bool on_closed(GdkEventAny *);
  };

But another way to do it is to grab the contents of the widget only -
then PreferencesWindow would have derived from Gtk::Window and the
constructor would have a call to add(contents_of_window);

-- 
Ole Laursen
http://www.cs.auc.dk/~olau/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]