[glade--]Bug fix for alignment used on buttons with stock icons



I found a bug tonight and fixed it from what I could grab out of cvs. 
When you create a button in glade, and then assign it a stock icon, the
lable and the icon ends up not being centered as it shows in glade and
as stock buttons are.  That was due to not constructing the alignment
properly with its x/yalign, and x/yscale properties.  So I added code
for that, and everything works correctly now.

As a side note, the newest Mandrake is not coming out with the latest
glademm (glademm-1.1.2-1mdk.i586 instead).  :(

-- 

Mark
http://www.utdallas.edu/~mej017200/
--- alignment.cc	2003-03-10 00:41:52.000000000 -0500
+++ newAlignment.cc	2003-03-10 00:41:44.000000000 -0500
@@ -28,8 +28,7 @@
 	Gtk_Alignment();
 	virtual bool NeedExplicitCtor(const Widget &w) const
 	{  return false; }
-	virtual void ConstructionArgs(Widget const &w, CxxFile &f) const
-	{  f.FunctionArg(); }
+	virtual void ConstructionArgs(Widget const &w, CxxFile &f) const;
 };
 
 static Gtk_Alignment Gtk_Alignment;
@@ -42,6 +41,18 @@
 {  return Configuration.GtkmmIncludePath()+"alignment.h";
 }
 
+void Gtk_Alignment::ConstructionArgs(const Widget &w, CxxFile &f) const
+{
+   if( w.hasProperty("xalign") && w.hasProperty("yalign") && 
+       w.hasProperty("xscale") && w.hasProperty("yscale") )
+   {
+      f.FunctionArg() << w.getFloatProperty("xalign");
+      f.FunctionArg() << w.getFloatProperty("yalign");
+      f.FunctionArg() << w.getFloatProperty("xscale");
+      f.FunctionArg() << w.getFloatProperty("yscale");
+   }
+}
+
 Gtk_Alignment::Gtk_Alignment()
 {  Writer["GtkAlignment"]=this;
 }


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