Re: Gtk::Button with custom icon and label
- From: Paul Pogonyshev <pogonyshev gmx net>
- To: gtkmm-list gnome org
- Subject: Re: Gtk::Button with custom icon and label
- Date: Sun, 8 Apr 2007 14:03:37 +0300
gallows wrote:
> Hi there!
> Well, I want create a custom button. I've tried this:
>
> Gtk::HBox* hbox0 = new Gtk::HBox(false, 0);
> Gtk::Label* label0 = new Gtk::Label("_Preview", true);
> Gtk::Image* image0 = new Gtk::Image(Gtk::Stock::YES,
> Gtk::ICON_SIZE_MENU);
> hbox0->pack_start(*image0);
> hbox0->pack_start(*label0, true, true, 5);
> button_preview.add(*hbox0);
>
> It works, but there is a memory leak...
> Should I use RefPtr<>? If yes, how?
Use manage(). Like manage (new Gtk::Label ("_Preview", true)).
Paul
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]