Anyone else doing control with GTK+ on Linux?

C

Thread Starter

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

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

('&%:9]!~}|z2Vxwv-,POqponl$Hjig%eB@@>}=<M:9wv6WsU2T|nm-,jcL(I&%$#"`CB]V?Tx<uVtT`Rpo3NlF.Jh++FdbCBA@?]!~|4XzyTT43Qsqq(Lnmkj"Fhg${z@>
 
> 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.

With our pvbrowser you write a pvserver.
There you do NOT have to care about any GUI library.
The GUI part is handled by our client (pvbrowser).
As the name suggests it is a type of browser but for ProcessVisualization thus the "pv" at the beginning.

The client is implemented on the basis of Qt and uses C++.

The pvserver uses ANSI-C but is not limited to this. You can use C++ as well for serverside programming.

This is our library for controlling the pvbrowser (ANSI-C).
http://pvbrowser.org/pvbrowser/sf/manual/html/modules.html

This is our C++ library for serverside programming.
http://pvbrowser.org/pvbrowser/sf/manual/rllib/html/classes.html

The framework of the pvserver is generated by our pvdevelop tool.

Viele Grüße:
pvbrowser
 
T

Tallak Tveide

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

C, GTK and Linux does not seem such a bad place to be in my opinion ;-)
 
Hi Curt,

I've been on a long vacation weekend, hence no response. The cast macros are nice in GTK because instead of just segfaulting it does give you a little more info. I've found that usually when one of their macro helper functions didn't work I was doing something stupid with a pointer. OOP is a little nicer than GTK+ because you can call methods instead of long function names and passing it widget pointers and other parameters. Most of the time it all equates to the same thing, but once in a while the OOP way allows you to do something that would have been really ugly in C! Having said that, GTK+ is a nicely desiged system and your company is already using it, so I don't mean to sound like I'm getting into a OOP vs. C argument, just noting what I've learned over the years.

I'd consider running some tutorials on natively programmed GTK+ apps (i.e.. Not glade). While glade can be a nice shortcut for some apps it can be quite confusing if you haven't done any raw GTK+ programming before.

I'm glad to hear you are hacking again and getting paid for it.

KEJR
 
C

curt wuollet

That would cost slightly more :^)

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

> ('&%:9]!~}|z2Vxwv-,POqponl$Hjig%eB@@>}=

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
 
Top