Re: [glade--]Fix for set_size_request



At 08:32 AM 10/23/2002 +0200, Christof Petig wrote:
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?

I did not notice that, maybe I did not look down far enough but that is not much farther down (assuming it is in the version from CVS that I grabbed earlier tonight, I'm in another OS right now and can not double check unfortunately), and I can not spot the spelling error either. It did not produce the correct code though (if it was in the version I pulled from CVS earlier). So debug might be needed. I will reboot and send you a private e-mail (just to save e-mail traffic) after I double check whether it was in there.

With this change it works for Gtkmm2.

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

Ah, the goodness of code peer review, especially by the guy who knows the code the best. :)

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);

I was hoping you might know or be able to tell from the debug I did. Hopefully it was somehow helpful to you in determining this.

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).

Is it considered good gui programming style to continually put vbox's inside of hbox's over and over as needed? What about if you have an hbox, that you want two buttons side by side in, in the same row, but you want some spacing between them (and only between them)? I thought fixed layout was the only way to do such things. Anyone who wants to jump in here and give me some info, feel free. This may not be the right listserv for it, but I don't want to cross post.

Thanks!

Mark




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