[glade--]Just some more things I ran across

Mark Jones <[email protected]>
Newsgroups gmane.comp.gnome.glademm
Message-ID <20021028052913.JSDM10046.out007.verizon.net@[127.0.0.1]>
Christof,

Here are some more issues I ran across this weekend.

Mark

111111111111111111111111111111111111111111111111

two "->" are generated for setting initial text of textview.  one possible fix is shown below (it worked for my case).

src/writers/textview.cc

void Gtk_TextView::Configure(const Widget &w, CxxFile &f,const std::string &instance) const
{  Parent::Configure(w,f,instance);
   WriteBoolProperty(w,f,instance, "editable");
   WriteBoolProperty(w,f,instance, "cursor_visible");
   WriteIntProperty(w,f,instance, "pixels_above_lines");
   WriteIntProperty(w,f,instance, "pixels_below_lines");
   WriteIntProperty(w,f,instance, "pixels_inside_wrap");
   WriteIntProperty(w,f,instance, "left_margin");
   WriteIntProperty(w,f,instance, "right_margin");
   WriteIntProperty(w,f,instance, "indent");
   WriteEnumPropertyNS(w,f,instance, "wrap_mode");
   WriteEnumPropertyNS(w,f,instance, "justification");
   std::string text=w.getProperty("text");
   if (!text.empty())
//BUG      f.Statement() << instance << "->get_buffer()->set_text("
      f.Statement() << instance << "get_buffer()->set_text("
      	<< Configuration.Translatable(text) << ')';
}

222222222222222222222222222222222222222222222222222222

I'm still seeing this problem with the source I pulled from cvs over the weekend.

src/Cxx.cc

void Cxx::WriteFooter(CxxFile &f,File_type tp)
{  if (!f.good()) return;
   switch(tp)
   {  case File_FOO_HH:
      case File_FOO_GLADE_HH: assert(0);
         break;
      case File_MAIN_CC:
         f.Definition().Funct_ReturnType("int").FunctionName("main")
         	.FunctionArg("int argc").FunctionArg("char **argv");
         f.StartBlock();
         if (Configuration.gettext_support)
         {  f.CppIf("defined(ENABLE_NLS)");
            f.Statement("bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR)");
            f.Statement("textdomain (GETTEXT_PACKAGE)");
            f.EndIf("ENABLE_NLS");
         }
	 if (!Configuration.gnome_support)
	    f.Declaration(WriterBase::GtkPrefix()+"Main m(&argc, &argv)");
	 else // perhaps trouble with gnome 2.0 and automake 1.5 ?
	 	// because there PACKAGE is not defined ?
	    f.Declaration() << WriterBase::GnomePrefix()+"Main m("
	       << "PACKAGE, VERSION, argc, argv)";
	 // isn't there a possibility to set an image path?
	 if (Configuration.use_libglade)
	 {  std::string gnome(Configuration.gnome_support?"_gnome":"");
	    f.Statement() << "glade"<<gnome<<"_init()";
	 }
	 f.EndLine();
         f.write_remembered(0);
      	 f.Statement("m.run(");
      	 if (GTKMM2)
      	 {  FOR_EACH_CONST_TAG(i,*top)
      	    {  if (i->Type()=="widget")
      	       {  Widget w(*i);
//BUG      	          f << Configuration.InstanceName(w.Name());
      	          f << "*" << Configuration.InstanceName(w.Name());

33333333333333333333333333333333333333333333333333333333333

Buttons with mnemonic are not setup correctly for gtkmm2:

Currently it generates:

   Gtk::Button *prefCancelButton = manage(new class Gtk::Button(""));
   dynamic_cast<Gtk::Label*>(prefCancelButton->get_child())->parse_uline("_Cancel");

It could just generate (I'm not sure if this is the easiest way or best way though, it is certainly the easiest way for hand coded gtkmm2, but I don't know if it is the easiest way for glade-- to generate the code):

   Gtk::Button *prefCancelButton = manage(new class Gtk::Button("_Cancel", true));

parse_uline() is what is causing the problem though for gtkmm2.  I just giving one alternative that I see.
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.