Re: how do it specify HeaderBar decorations?



ok, sorry, I'm new here
 
here's what I did to get it to work:

class WinSprdSht : public Gtk::Window
{
...
    gboolean hide_widget_on_delete(GdkEventAny* event, Glib::ustring data);
    void on_mybutton(Glib::ustring data);
...
    Gtk::HeaderBar     *m_HdrBar;
    Gtk::Window          *m_Window;
...
}

WinSprdSht::WinSprdSht( string someTitle, int MaxTabs )
{
...
    m_HdrBar = new Gtk::HeaderBar[MaxTabs];
    m_Window = new Gtk::Window[MaxTabs];
...
    m_HdrBar[nTabs].signal_delete_event().connect(
        sigc::bind<Glib::ustring>( sigc::mem_fun(
            this, &WinSprdSht::hide_widget_on_delete), SomeTitle) );
...
}

gboolean
WinSprdSht::hide_widget_on_delete( GdkEventAny* event, Glib::ustring data)
{
    for(int n = 0; n < nTabs; ++n) {
        if( m_HdrBar[n].get_title() == data ) {
            m_Window[n].hide();
            return true;    // return true to prevent default method
        }
    }
    return false;
}

btw, thanks for all the help

John


From: Phil Wolff <adiabat centurylink net>
To: John Siino <jmsiino_sr sbcglobal net>; "gtkmm-list gnome org" <gtkmm-list gnome org>
Sent: Thursday, June 14, 2018 7:31 AM
Subject: Re: how do it specify HeaderBar decorations?

Please use "reply all" when responding so the list can see both sides of the conversation.

On 06/14/2018 00:09, John Siino wrote:
in gtkmm I would like to eliminate the minimize and maximize buttons.  I am successfully capturing the signal_delete_event(), but when I try to capture the signal_hide() all my windows minimize instead of just one.  So I would like to eliminate the minimize and maximize buttons.  Here is what I have:

Gtk::Window            *m_Window
...
m_Window[nTabs].set_type_hint(Gdk::WINDOW_TYPE_HINT_NORMAL);
...
//  here is where I would like to set the decorations
m_Window[nTabs].HeaderBar.set_decoration_layout( "icon:close" );



John


_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
https://mail.gnome.org/mailman/listinfo/gtkmm-list

--
Those who dance are considered insane by those who cannot hear the music.
   — George Carlin




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