# Anyone else doing control with GTK+ on Linux?

C

#### curt wuollet

The title says it all. My new job is working on the overall control of a machine with many modules, all on Ethernet. Since GTK+ is very new and strange to an old systems programmer, I was wondering if my favorite resource would be of use for those questions :^) And no, the irony is not lost on me :^) At least it's not Windows.

Regards
cww

P

#### pvbrowser

> The title says it all. My new job is working on the overall control of a
> machine with many modules, all on Ethernet.

We use Qt instead of GTK http://pvbrowser.org
But there is a library for serverside programming that is not related to a GUI toolkit. It was developed as a standalone library that is portable over several operating systems. It uses C++. Within there you should find several classes that might be interesting to you.

See:
http://pvbrowser.org/pvbrowser/sf/manual/rllib/html/classes.html

But the question remains.
Why GTK ? Qt is also an option. Even better in my opinion.

P

#### pintoshine

I am using gdk, gtk, and gtk+ in my custom kiosk controllers I build for the micro-distilling industry. I have been a native unix/linux and windows developer in c/c++ for many years.

Many years ago I developed a style of bitmap backed controls libraries that work on many different platforms. Since I am handling all the hardware i/o and screen i/o it allows for a very nice HMI and near realtime hardware control.

Currently I am working on a system to allow a user to program a sequence of command based on their specific equipment. I would be glad to provide some sample source and guidelines on setting Fedora up as a kiosk.

K

#### Ken E

I've used GTK+ with C and now ported to GTK# with C#/mono for HMI development. This communicates to a RTOS over shared memory currently. I'm finding performance issues with the C#/mono environment at the moment and I don't think there is a lot that I can do to optimize this short of going back to a cross compiler setup or compiling on the embedded target (it is not x86). I do like GTK+ in a lot of ways and find it refreshing to have complete control of how memory is managed (string in C# are very inefficient!). Having said that you are responsible for complete memory management, so it's a double edged sword! We build machines for factory automation and often there isnt' a lot of time allocated for HMI development.

I like the fact that you can put everything into one GTK+ C application. I wish that I could do that but our applications require hard RTOS response (using Xenomai at the moment). That may change in coming years with low latency patches and all of that, but it is what it is right now.

Good luck with the project. I can't say I need it since we aren't in the Kiosk industry, but it sounds useful.

One question: Do your custom bitmapped widgets tend to be faster/lighter than inheriting/modifying existing widgets?

KEJR

C

#### curt wuollet

Thanks Pintoshine

But they are paying me to _write_ software. I was just hoping that there were folks that could help out should I get stuck like the other day when one of the interesting "cast-macros" that gtk uses was returning a fairly inscrutable error message and aborting. Eventually, I just did the pointer cast myself and went on, but it would be good to know why it was failing. It has been really interesting learning gtk and the glib underpinnings. I have never done so much pointer manipulation, so it was like learning C again as well. A lot of the stuff is still fuzzy, but I think that's just the way is is and you get used to it. I merged a new module into the trunk and we'll see how it works. It is rather odd _just_ programming, no wiring, no grease, no ordering parts, no hand tools. But, I don't miss climbing sand towers or wetting my t shirt down to prevent fires.

Regards
cww

C

#### curt wuollet

Hi Ken,

For what I'm doing, the glade approach works fairly well and saves a lot of fiddling around. They are just config windows and the like. The "goodness" of gtk hasn't quite gelled with me as I'm pretty much just doing what it takes to do it, but eventually it will make more sense, I hope. And with a little luck, I may never need to compare it with MS programming. One of the reasons for gtk, I'm told is that it is conceivable the code may run on Windows at some point, but it doesn't change what I'm doing. Coding in C on a fast linux box is pleasant enough and it's going fairly well after some initial confusion. I've never been a big fan of IDE's, but using Eclipse is winning me over from writing make files and doing it all by hand. All in all, having a job writing C is rapidly increasing my knowledge and understanding in a way only coding every day can. So it's been good so far.

Regards
cww

C

#### curt wuollet

Why GTK? because that's what it's already written in:^)

And I happen to prefer C to C++. I know, I know, no class :^)
But, it was getting pretty close to the point where I'd write in RPG or COBOL as long as it paid.

Regards
cww

S

#### Steve Myres

"But, it was getting pretty close to the point where I'd write in RPG or COBOL as long as it paid."

Even Malbolge? ;-)

If any of you haven't heard of this fine language (named after the eighth circle of the inferno), this Malbolge program displays "Hello world!", with full capitalization and exclamation mark at the end.

Regards
cww

C

#### curt wuollet

Well. I'd never considered being a full time programmer before, but it has it's advantages. Not quite as good as doing new automation, but better than maintenance. Clean, cool, quiet, and sustainable. And I think I am reasonably good at it. A little short on variety, but I'm not trashed at the end of the day. And it beats cutting a dozen cords of firewood to keep from freezing. That's if I can find a place to live.

Regards
cww