how do it specify HeaderBar decorations?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

how do it specify HeaderBar decorations?

jmsiino_sr@sbcglobal.net
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
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|

Re: how do it specify HeaderBar decorations?

Daniel Boles
So that's what you have. And what happens? I presume it doesn't hide the buttons as you wanted?


_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|

Re: how do it specify HeaderBar decorations?

Daniel Boles
Ah, well that is just a syntax error. You need to manage your own headerbar, add it to the window with set_titlebar(), and then you can control what it shows in the window titlebar.

_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|

Re: how do it specify HeaderBar decorations?

Daniel Boles
Is that a statement or a question? :) Anyway, use CSS to do those things.


_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|

Re: how do it specify HeaderBar decorations?

Phil Wolff-2
In reply to this post by jmsiino_sr@sbcglobal.net

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
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list

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

_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|

Re: how do it specify HeaderBar decorations?

jmsiino_sr@sbcglobal.net
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 <[hidden email]>
To: John Siino <[hidden email]>; "[hidden email]" <[hidden email]>
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
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list

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



_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list