Re: [glade--]Fix for set_size_request



Mark Jones wrote:
I looked into this tonight.  There are two things missing related to size and positioning (that I see):

1.  Set size request not written.  The source of this is in: writers/widget.cc (line 85)

void Gtk_Widget::Configure(const Widget &w, CxxFile &f,const std::string &instance) const
{
....some lines of code here
// then:
WriteIntIntProperty(w,f,instance, "width", "height", GTKMM2?"size_request":"usize");
// Should be:
WriteIntIntProperty(w,f,instance, GTKMM2?"width_request":"width", GTKMM2?"height_request":"height", GTKMM2?"size_request":"usize");

That's wrong because the name of the tag is not dependant on the gtkmm version installed but on the glade version which created the file (=> Configuration.glade2). [just to explain]

Do you see the following line in widget.cc:89

  WriteIntIntProperty(w,f,instance, "width_request", "height_request",
        GTKMM2?"size_request":"usize"); ?

Doesn't it work for you? If not I have to debug it (it _looks_ perfectly right to me). Perhaps a spelling bug?

With this change it works for Gtkmm2.

But creating gtkmm2 projects from a glade-1 file is broken ;-)

You'll notice I just copied the properties out of the packing section to the section above.  Then it finds them as properties when it looks for them in writers/fixed.cc:
void Gtk_Fixed::AddChild(const Widget &w,CxxFile &f,const std::string &instance) const
{  int x=w.getIntProperty("x",0);
   int y=w.getIntProperty("y",0);

The problem is that the wrong tag is used. w is the <widget> and not the <packing> tag. Fix is:

   const ChildParamList ch(w.get_Child_params());
   int x=ch.getIntProperty("x",0);

[in glade-1 the <packing> tag was called <child> and had been a child of <widget>, so that's why it looks this way].

Actually in glade-1 <x> was a child of <widget> and not <child> aka <packing>.

fixed in CVS

I just never use fixed because once you swith the theme/font/language it get's a mess (or only ugly if you are lucky). But people used to other visual design tools prefer it because it's easier to place the widgets by hand than designing an well looking vbox/hbox/table/alignment hierarchy (if I guess right).

Yours
   Christof




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