[glade--]fix for accelerator without ALT/CTRL/etc



This fixes the case when you have an accel with just a key and no
modifier.  It was printing just a 0, which works with gtk, but not
gtkmm, so I cast it properly such that it does work.  

Of course, really in the 0 case, it doesn't need to do:
f << "Gdk::ModifierType(" << modifiers << ")" << ",
Gtk::ACCEL_VISIBLE)";

because since we know modifiers is equal to 0, we could have just done:
f << "Gdk::ModifierType(0)" << ", Gtk::ACCEL_VISIBLE)";

but I was not sure what style is preferred.

-- 

Mark
http://www.utdallas.edu/~mej017200/
? patch.diff
Index: src/writers/widget.cc
===================================================================
RCS file: /cvs/gnome/glade--/src/writers/widget.cc,v
retrieving revision 1.54
diff -u -r1.54 widget.cc
--- src/writers/widget.cc	20 Dec 2002 07:58:48 -0000	1.54
+++ src/writers/widget.cc	26 Dec 2002 01:19:57 -0000
@@ -150,7 +150,10 @@
 	      f << "(GdkModifierType )" << modifiers << ", GTK_ACCEL_VISIBLE)";
 	   else // gtkmm2
 	   {  replace_all(modifiers,"GDK_","Gdk::");
-	      f << modifiers << ", Gtk::ACCEL_VISIBLE)";
+              if ( modifiers == "0" )
+                 f << "Gdk::ModifierType(" << modifiers << ")" << ", Gtk::ACCEL_VISIBLE)";
+              else
+                 f << modifiers << ", Gtk::ACCEL_VISIBLE)";
 	   }
  	 }
       }


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