LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-13-2005, 09:08 PM   #16
johnMG
Member
 
Registered: Jul 2003
Location: CT, USA
Distribution: Debian Sarge (server), Etch (work/home)
Posts: 601

Rep: Reputation: 32

> But I would definitely recommend not using gtkmm.

You haven't really given a reason MA_D. Why would you not recommend using gtkmm? Have you had a bad experience with it in the past? Was it difficult to install along with all its dependencies? You should give actual reasons besides just saying not to use it.
 
Old 04-13-2005, 11:10 PM   #17
MA_D
Member
 
Registered: Apr 2005
Location: Iowa
Distribution: Archlinux/RHEL/FreeBSD
Posts: 41

Rep: Reputation: 15
It's unnecessary. It's just extra overhead. It likely makes use with c++ a little nicer, probably makes your c++ a little prettier. But in the end you are just asking your users to install gtkmm, glibmm and then gtk (they almost invariably have gtk). Not to mention, many apps require older versions of gtkmm, which is quite annoying.

I've never coded for it, only for gtk. So I can only speak for the niceties of gtk, but I am totally happy with gtk and can't see why one would want to put a layer between it and their app that doesn't add any portability.
 
Old 04-14-2005, 04:49 AM   #18
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
Quote:
Originally posted by MA_D
It's unnecessary. It's just extra overhead. It likely makes use with c++ a little nicer, probably makes your c++ a little prettier. But in the end you are just asking your users to install gtkmm, glibmm and then gtk (they almost invariably have gtk). Not to mention, many apps require older versions of gtkmm, which is quite annoying.

I've never coded for it, only for gtk. So I can only speak for the niceties of gtk, but I am totally happy with gtk and can't see why one would want to put a layer between it and their app that doesn't add any portability.
http://www.autopackage.org
http://statifier.sf.net

solved your problem.
 
Old 04-14-2005, 11:32 AM   #19
MA_D
Member
 
Registered: Apr 2005
Location: Iowa
Distribution: Archlinux/RHEL/FreeBSD
Posts: 41

Rep: Reputation: 15
No.
Statically linking to gtkmm and glibmm would be quite rude.. It took me over an hour to compile gtkmm, it's quite large. It would be very rude to impose that upon your users..

I'd try coding in pure gtk first. And if you really can't stand it, use gtkmm. Just understand, you may get some complaints. More likely you'll just lose a few users (I've avoided apps for having gtkmm before, because I just didn't wanna install it). I finally did install it for inkscape, man that was a pain...
 
Old 04-14-2005, 11:38 AM   #20
mhearn
LQ Guru
 
Registered: Nov 2002
Location: Durham, England
Distribution: Fedora Core 4
Posts: 1,565

Rep: Reputation: 57
If you don't want to compile things from source, use binaries. Nobody should be scared away from using useful libraries because some users don't want to wait for the compiler - those people should not be compiling in the first place.

The whole discussion over whether you can statically link GTKmm or not is precisely so binaries can be produced easily.
 
Old 04-14-2005, 07:14 PM   #21
MA_D
Member
 
Registered: Apr 2005
Location: Iowa
Distribution: Archlinux/RHEL/FreeBSD
Posts: 41

Rep: Reputation: 15
Of course you *can* link it; I'm saying you shouldn't. It's wasteful.

One should consider how the popularity of a library they use may effect the usability of the applications for the user. If the library is not easily gotten by most users it will become a blockade that many will choose to avoid. This doesn't mean you can't use that library, it means it's a cost of using it. And so, one must way that cost against the benefits. In the case of gtkmm: I hold the opinion that the benefit is zero, because it's not really a library it's a language binding. A rather large language binding, that's not necessary (helpful maybe, but not necessary).

Anyway, it's up to him. But for the reason that gtk is accessible from c++ without bindings, and is very nice to code for in itself; I state that it is my opinion that it is entirely unnecessary and is just a hassle for the user more than a help for the developer.


I tried autopackage btw when I had to install gtkmm for inkscape. Autopackage wasn't much help in that arena. I do like autopackage though; but I don't see its relation to static linking. My understanding is that you do not lose dynamic linking with it, it just complicates it a bit more. Maybe I read wrong? But it still requires dependencies, and so I would assume it is not static linking.

Static linking could get quite bad if everyone did it on a linux desktop...
 
Old 04-14-2005, 08:49 PM   #22
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178

Original Poster
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Hi,

I think pure GTK is actually quite Object Oriented even though it's written in C. As such I am quite comfortable with GTK and I see no reason to use GTKmm, so I guess it's just a matter of personal choice.

However, libglade is a more serious issue. I'm not yet totally convinced of the need to use libglade in place of code generation from Glade (which works quite superbly to be quite honest and I cannot understand why this feature is "deprecated").

I just think that libglade is an extra dependency. But I want experienced programmers' to help me here: how many extra libraries are used when you use libglade?
 
Old 04-14-2005, 10:46 PM   #23
MA_D
Member
 
Registered: Apr 2005
Location: Iowa
Distribution: Archlinux/RHEL/FreeBSD
Posts: 41

Rep: Reputation: 15
I agree, I just use glade to generate the code. It's prolly deprecated because they don't support the latest gtk. But I end up editing it up myself later anyway so I don't care. I just like it to take the painstaking work of writing 600 lines of repetitive code... It does it for me in minutes!
 
Old 04-15-2005, 01:17 AM   #24
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
Why use gtkmm instead of GTK+?


1. gtkmm allows you to write code using normal C++ techniques such as encapsulation, derivation, and polymorphism. As a C++ programmer you probably already realise that this leads to clearer and better organised code.
2. gtkmm is more type-safe, so the compiler can detect errors that would only be detected at run time when using C. This use of specific types also makes the API clearer because you can see what types should be used just by looking at a method's declaration.
3. Inheritance can be used to derive new widgets. The derivation of new widgets in GTK+ C code is so complicated and error prone that almost no C coders do it. As a C++ developer you know that derivation is an essential Object Orientated technique.
4. Member instances can be used, simplifying memory management. All GTK+ C widgets are dealt with by use of pointers. As a C++ coder you know that pointers should be avoided where possible.
5. Less code. The GTK+ C object model uses prefixed function names and cast macros. For instance:
Code:
      gtk_button_set_text(GTK_BUTTON(button), "sometext");

      gtkmm C++ code is shorter and clearer. For instance:

      button.set_text("sometext");
6.There's no need to worry about GTK+'s inconsistent reference-counting policy.

Gtkmm is not weird library. It is a common one. You can get gtkmm binary from your official distro repositories. So you can install it by apt-get, yum, emerge.... Gtkmm is not a third party like library.
If you are afraid that using gtkmm or libglademm will make the installtion hard for user, considering MySQLAdmin:
http://dev.mysql.com/downloads/administrator/1.0.html

It use gtkmm library.

Of course beside static linking, autopackage is a nice option. Sure you can program GTK+ with C++ without binding just like in GnomeMeeting or d4x. But you loose the advantages. Anyway it is a personal preferences. If you think gtkmm will make the installation harder but you want to use C++, why don't use wxwidget??? This library is more popular than gtkmm.... It use GTK+ anyway.

For Harishankar:
libglade comes with standard Gnome desktop. Gedit use libglade. So if you target Gnome user, you don't have to worry with libglade dependencies. The case will be complicated if you target fluxbox or windowmaker user..... then why don't use light weight library like fltk???
 
Old 04-15-2005, 07:18 AM   #25
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178

Original Poster
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Quote:
libglade comes with standard Gnome desktop. Gedit use libglade. So if you target Gnome user, you don't have to worry with libglade dependencies. The case will be complicated if you target fluxbox or windowmaker user.....
I do not want to target Gnome or KDE users. That's the problem. I just want to target any Linux desktop which would have GTK installed. Again, does libglade come only with Gnome dependencies?

The real problem is that I am striving very hard to prevent my apps from linking to the DE specific libraries (either KDE/Gnome) and link only to the underlying QT or GTK.

Quote:
then why don't use light weight library like fltk???
I would prefer wxWindows/wxWidgets to any other if that should be the case. But currently I prefer not to re-learn what I already have learnt and am comfortable with: namely GTK with C.
 
Old 04-15-2005, 08:08 AM   #26
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
Quote:
Originally posted by Harishankar
[B]I do not want to target Gnome or KDE users. That's the problem. I just want to target any Linux desktop which would have GTK installed. Again, does libglade come only with Gnome dependencies?
Libglade is not Gnome libraries. It is GTK+ library. There is Windows version of libglade anyway. To make it short: Gnome users already have libglade library. Abiword users, Gthumb users and Evolution users have this library too. So... libglade is a common thing. It is very rare that people don't have this library. I mean abiword, gthumb and evolution are popular applications right???!!!!!!
 
Old 04-15-2005, 08:33 AM   #27
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178

Original Poster
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Ok, thanks. I will take a look at libglade anyway!

Gtkmm also. I like C++ so I think I'll try it out.

Autopackager I may use. But not statifier. It is against Linux principles to link statically so I will avoid it as much as possible.
 
Old 04-15-2005, 12:00 PM   #28
mhearn
LQ Guru
 
Registered: Nov 2002
Location: Durham, England
Distribution: Fedora Core 4
Posts: 1,565

Rep: Reputation: 57
Actually the Inkscape autopackages statically link GTKmm these days, it's not so bad.

I'd really use libglade, it's generally regarded as much better and so much stuff uses it, it's practically guaranteed to be present.
 
Old 04-15-2005, 03:52 PM   #29
MA_D
Member
 
Registered: Apr 2005
Location: Iowa
Distribution: Archlinux/RHEL/FreeBSD
Posts: 41

Rep: Reputation: 15
3.) is the only valid one you listed, that's a c lover's opinion .

Pointers should be avoided in c++, not in life .

I take that back, 1 is valid too, but 1 and 3 are awfully related points.
 
Old 04-15-2005, 03:55 PM   #30
MA_D
Member
 
Registered: Apr 2005
Location: Iowa
Distribution: Archlinux/RHEL/FreeBSD
Posts: 41

Rep: Reputation: 15
Yea, gtkmm is pretty common. But RHEL4 seems to lack it for whatever reason; and I loathe 3rd party rpm's (they never seem to be done correctly).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Migrating the programmer Marc L. Linux - General 6 05-04-2010 03:19 AM
Programmer to Programmer ( Long Story Of A GUI ) mdoubledragon Programming 1 10-13-2005 05:41 PM
Should I become a programmer? coolblue Programming 10 09-18-2005 09:36 PM
looking for programmer and advice kosit Programming 1 05-06-2005 06:04 PM
programmer wanted. Ciccio Programming 57 01-11-2003 01:28 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration