[glade--]bug fix for label.cc

Mark Jones <[email protected]>
Newsgroups gmane.comp.gnome.glademm
Message-ID <[email protected]>
I found this when I created a non stock button with a stock image (which
creates a label for that button).  It was not handling mnemonics
properly in that case.  I tested it with a variety of possible labels
and buttons and it got them correct.

diff -u src/writers/label.cc ~/bugfixes/label.cc 
--- src/writers/label.cc        2002-12-19 16:54:41.000000000 -0500
+++ /root/bugfixes/label.cc     2002-12-19 16:54:21.000000000 -0500
@@ -36,6 +36,14 @@
 
 void Gtk_Label::ConstructionArgs(const Widget &w, CxxFile &f) const
 {  f.FunctionArg() <<
Configuration.Translatable(w.getProperty("label"));
+
+      std::string label=w.getProperty("label");
+      if ( GTKMM2 && 
+           w.getBoolProperty("use_underline") && 
+           ( label.find('_')!=std::string::npos ) )
+      {
+         f.FunctionArg() << "true";
+      }
 }
 
 bool Gtk_Label::NeedExplicitCtor(const Widget &w) const

Mark
project30.glade (application/x-glade, 5 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.