Re: bitmap in button doesn't appear in 64bit 9.10



Thanks.  After some digging, I managed to find out how to set the settings:

    // Set button/menu images on by default -- 9.10 turned them off
    GtkSettings *settings = gtk_settings_get_default ();
    gtk_settings_set_long_property (settings, "gtk-button-images", 1,
".gtkrc:0"); // I don't understand the significance of the origin param.  I
just saw this on some thread and tried it -- it works...
    gtk_settings_set_long_property (settings, "gtk-menu-images", 1,
".gtkrc:0");

Thanks, again!

-Garth

On Tue, Jan 19, 2010 at 11:35 AM, Tadej BorovÅak <tadeboro gmail com> wrote:

Hello.

The following code works great in 32 bit and 64bit <= 9.04, but no bitmap
appears when I run in 64bit 9.10.

   Gtk::Image* img = NULL;
   if (btnImageName.length() > 0)
   {
       cppstring path = GUtils::OSGetIconFolder() + btnImageName +
L".png";
       img = new
Gtk::Image(GTextUtils::ConvertUTF16WideStringToUTF8String(path));
   }

   Gtk::Button* btn = new Gtk::Button;
   if (img != NULL)
   {
       btn->set_image(*img);
       btn->set_image_position(Gtk::POS_LEFT);
   }
   btn->set_alignment(0.0, 0.5);
   btn->signal_clicked().connect(sigc::bind(sigc::mem_fun(this,
&LXLiveReadoutManager::ToggleSourceWindow), sourceID));
   m_ButtonMap[sourceID] = btn;
   m_ButtonBox->add(*btn);

   m_ButtonBox->show_all();

I think this is Ubuntu's "fault". They decided to reduce visual
clutter and trim images from menu items, buttons, etc. by default.
User can change this by setting "gtk-button-images" and
"gtk-menu-images" GtkSettings to TRUE, but I cannot help you with GUI
tools, since I don't use Ubuntu or GNOME.

Tadej


--
Tadej BorovÅak
tadeboro.blogspot.com
tadeboro gmail com
tadej borovsak gmail com




-- 
Garth Upshaw
Garth's KidStuff



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