GladeToBac question

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
wallyg
Posts: 87
Joined: May 08, 2009 7:08
Location: Tucson Arizona

GladeToBac question

Postby wallyg » May 19, 2018 20:43

I was just wondering if GladeToBac will ever be updated to meet the new GTK versions. The version that I got from the download site has some signal processors with the wrong argument lists (widget - button press is generated with two arguments, but documentation specifies 3 as an example).

Thanks
Wally
caseih
Posts: 1302
Joined: Feb 26, 2007 5:32

Re: GladeToBac question

Postby caseih » May 20, 2018 4:21

I doubt it because the recommended way of using Glade in GTK+3 is with the GtkBuilder class. Instead of generating code from your ui file, you instead load the ui file at runtime and GTK+ creates the gui objects on the fly. See this C example, directly translateable to FB:
https://developer.gnome.org/gtk3/stable/ch01s03.html
wallyg
Posts: 87
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: GladeToBac question

Postby wallyg » May 20, 2018 7:57

GladeToBac has used this method for as long as I have used it. It however also automatically generates declarations for each widget so that you can reference that widget in your source code with out having to change your declarations every thing you add/subtract widgets from your model. It also automatically generates all the signal handlers to actual routines in your code. That would reduce your example size by half. I have models that have hundreds of widgets and hundreds of signals and trying to keep these updated in sync with test variations of the UI would drive one crazy. It also automatically generates the proper headers for new signals SUB/FUNCTION and the proper set of arguments and their proper type declarations which is indispensable in getting it right. It really is a most desirable routine.

But I suspect you are right in that it will not be updated, I was just hoping.

It seems to use a data file that contains the prototype of the signal header for all signals. The prototypes are in C. I was hoping it was a file from the gtk group and that I could get a more up to date version.

Wally
caseih
Posts: 1302
Joined: Feb 26, 2007 5:32

Re: GladeToBac question

Postby caseih » May 20, 2018 14:03

The download page for GladeToBac indicates it supports GTK3. https://www.freebasic-portal.de/downloa ... c-190.html.
wallyg
Posts: 87
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: GladeToBac question

Postby wallyg » May 20, 2018 17:17

Yes it looks like GTK 3.0. The world is up to 3.22 and many many changes have been made and the definitions in GladeToBac are wrong in places for current system. I think it reflects GTK as it was in 2012.

Wally
caseih
Posts: 1302
Joined: Feb 26, 2007 5:32

Re: GladeToBac question

Postby caseih » May 20, 2018 21:45

Are you saying GladeToBac is generating code that won't compile with GTK 3.22? That doesn't sound right. Can you post an example? If indeed thisi s true, this is a bug, as GTK 3.0 defines a compatible ABI across the entire 3.x release cycle. GladeToBac ought to work just fine with GTK 3.22. There shouldn't be any definitions in GladeToBac that are "wrong" for GTK 3.22. Brand new classes might be missing, but nothing should be broken.

Either way, this illustrates the problems with code generators. GtkBuilder is more flexible and will never have these problems. You only have to create your callbacks once, so I don't see this as particularly burdensome.
wallyg
Posts: 87
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: GladeToBac question

Postby wallyg » May 20, 2018 22:33

for the signal button_release, GladeToBac generates a prototype with two args (widget,user-data) the documentation says 3 args (widget,gdkevent,user_data). If one signal prototype is wrong, how many others that I have not looked into in detail are wrong. The entire set of signals need to be checked out. Also there are many new calls by version 3.22 that are not in GTK3.BI that I cannot get to because the GTK3.BI that comes with FB 1.05 release is for 3.16.

So yes there needs to be lots of work regardless what out of date (6 year out of date) documentation says. Do not believe anything that documentation says if it is that far out of date or what promises someone at that time said.

I was just trying to get some information so that I might try to get one small part correct. Not the grief you give me because the documentation says something that does not meet reality.

TFJ sent me some information on how he created the Signals3.def file. I will look into this in the coming weeks. When it gets to 11x F during the day here in Tucson, I spend a lot more time indoors. Right now I am finishing up the large green house I built for my wife and putting air conditioning into it while the temperature is only in the high 90s.

Wally
wallyg
Posts: 87
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: GladeToBac question

Postby wallyg » May 20, 2018 22:38

You obviously do not know how GladeToBac works. The code it generates uses GTKBUILDER. It is the auxiliary things it does to supplement GTKBUILDER that is why it is a great program to use. It reduces my work by 70%+ and most importantly my error rate by at least that much. And yes GTKBUILDER is a great addition to the GTK World. And Glade has become a premier GUI creation program even though it occasionally dies for no reason at all and loses work from the last save up to the time of the unscheduled termination.

Thank you TFJ for a great wonderful program GladeToBac. You are the greatest.

Wally
caseih
Posts: 1302
Joined: Feb 26, 2007 5:32

Re: GladeToBac question

Postby caseih » May 21, 2018 2:17

No I don't have experience with GladeToBac. I do, however, have experience with GtkBuilder (and I've been using libglade instead of code generation going back to GTK 2 days) standalone. Interesting to learn of GladeToBac's features. Also good to hear that TJF has sent you information. That's a nice thing about community-developed software. I echo your thanks to TJF!

Return to “Libraries”

Who is online

Users browsing this forum: No registered users and 1 guest