Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Technology

Writing Apps for GNOME *and* KDE? 220

Dr. Tom asks: "I want to write an application that will play nice with both the GNOME and the KDE desktops (and possibly others). Without having developed anything for either, and after glancing through some of the docs, it seems like GNOME apps need to be written with GTK+ while KDE apps need to be written using Qt. Since I don't want to write my app twice, I'd like to know if there are any tools/abstraction layers that I can use to get some desktop functionality without having to worry about which desktop I'm running on. I expect this problem to have relatively wide interest as I notice quite a bit of duplication of effort among the different desktop applications (Knotepad, Gnotepad, Kcalendar, Gcalendar, etc.). It would be nice if some of that code could be shared -- or are desktop apps doomed to be tied to a particular desktop?" I certainly hope not. Applications which work on both frameworks are a necessity if Linux is to become a choice for the general desktop user.
This discussion has been archived. No new comments can be posted.

Writing Apps for GNOME *and* KDE?

Comments Filter:
  • i disagree that KDE/Gnome need to meld into one.

    i think that as long as you can at least *use* apps on both sides of the fence (which in my experience you can) that's enough. having everybody's eyecandy and special integration features isn't needed, and maybe not even wanted. why?

    IMO: gnome and kde are being designed with slightly different viewpoints on life (or at least on desktop computing =). this is Good. what one camp forgets, the other remembers. and what they other remembers, the first wants. it means a friendly competition between the projects that propels both.

    same for apps. if there is a gnome text editor and a kde text editor and one puts in a Cool New Feature(tm), what are the odds the other one will adopt it, if it fits in their view of the desktop computing? pretty good, i'd say. again, competition is good.

    what is more important that desktop amalgamation is the adherence to standard file formats so everyone, regardless of their desktop preferences and application choices can read/edit the same files.

    think picasso and michelangelo. way different styles. both awesome. both had brushes.

    Aaron J. Seigo

    No account yet. ha.

  • by Anonymous Coward
    After all, that's the joy of Slashdot (which is an app and a service).

    Forget toolkits. Linux-only development is a dead-end. Write for the web and maybe you'll make some bucks like CmdrTaco and Jerry Yang.

  • I was part of a team developing a web front end for a product. Web apps have *many* more compatability issues than desktop apps. For starters most apps are complicated enough you have to use Javascript (or heaven forbit vbscript). The headache is every browser handles things differently, and all of them are loaded with unique bugs (which are out of your control). Didn't you read that article on bugs in software?
  • by Anonymous Coward
    Sure you can run gedit on your kde desktop --but can you drag a .txt or unattributed file to gedit from KFM? It doesn't work. This is the simplest level of interoperability and it's not there.

    Here's another boneheaded obstacle: in Gnome I can drag a http link from Netscape to the Gnome desktop, managed by GMC; in KDE I can drag a a link from Konqueror to the desktop and even a folder, but I cannot drag a link from Netscape. Huh? It's a url--handle it! Well for some reason this has slipped KDE developers attention. Which is funny because you can drag a link from StarOffice (an earlier Mozilla version) to a KDE folder to be copied or linked. So apparently, KDE people just don't want to make allowance for people using Netscape on a KDE desktop. Now you know what they have in common with Microsoft!

    Both Gnome and KDE need to cooperate with each other and with major established apps. The alternative --each project trying to freeze out the other-- will mean they both will be failures.

  • by Anonymous Coward
    This is inherently a tricky question. Do you need to write an application that runs in and plays nicely with both GNOME and KDE? This is not a difficult thing to do at all. Do you need more advanced features of KDE and GNOME? That starts to get difficult.

    I think it would be safe to implement the entire application in either GTK+ or Qt 2, and provide a theme to emulate the opposite environment. Unfortunately, if they're not using the default theme your app would still look out of place. The only way to solve this would be for someone to develop a theme converter.

    For features that depend upon certain desktops, you'll simply have to write the code twice or abstract it. e.g., panel applets, VFS or media filters, session management. All of these things would need a new abstraction layer or would need to be implemented twice. I think drag-and-drop should work between the two, so that isn't a problem.

    What would probably give you huge problems are if you want any sort of application embedding features via GNOME's Bonobo or KDE's KOM/Openparts object models. These two are not similar, and probably couldn't even be abstracted well. Implementing it twice seems difficult and not really worth the effort, but I could be wrong. I'm not very familiar with KOM/Openparts.

    Cody,
    bratsche@dfw.net
  • by Anonymous Coward
    Not sure exactly at what level you want to "use" KDE and / or GNOME. However, I would suggest,regardless of what the end result *should* be, to look seriously into Design Patterns before you even design anything.

    Reason I say this is that by using these patterns (they are originally inspired by architectural design patterns research from the 1970's) you can nicely and neatly separate away the "nasty parts" (the implimentation specific parts) from the "generic parts" (i.e. the core, GUI-independant functionality) and maintain them nicely. I would suggest as starters to look at the Bridge, Factory, Prototype and Observer patterns (not that they and only they will solve your problems, but they cover a good range of the possible *uses* of patterns and I can already see some uses). And definitely get Gamma (sp?) DP book - worth every penny I paid!!!! Plus lots of great web sites out there - simply type "Design Patterns" into your favourite search engine and away you go!!!!

    Good luck!
  • by Anonymous Coward
    Odd that noone mentioned wxWindows. Not only does it do GTK, it does Motif and, Mac and Windows. A Qt port is "underway." It has wonderful Python bindings, for extremely rapid development. In fact, if you write your programin in Python it will run unchanged, and unrecompiled on Mac, Win32, GTK, AND Motif-based systems!
  • by Anonymous Coward
    Gnome doesn't look dead from where I'm standing.
    Pronouncing the other players as "Dead" for no reason is a FUD tactic.

    When I see the promised "KDE Replacement for Gimp", which supposedly would only take "a couple of weeks" due to the amazing Qt, then tell me about how Dead the Gnome is.
    What do all those KDE developers use to draw their graphics? Gimp!
    Which desktop environment STILL WON'T WORK with any other DnD system even in 1.1.2? KDE!
    Which one has working apps that load MS Office documents? GNOME!

    So what's dead about Gnome?
  • by Anonymous Coward
    Perhaps something based on graphapp? You can find it at: http://www.cs.su.oz.au/~loki/graphapp/ It plays nicely with Athena, Motif, Windows, and Macintosh so far, and I expect that you could port it to GTK and QT, also. Linux Long and Prosper
  • by Anonymous Coward
    You should try Glade, at http://glade.pn.org [pn.org]
    It is very mature, and has a different (and IMHO saner) philosophy then KDevelop, in that it generates an xml description of a UI. This description, when used with libglade, leads to very rapid development. For most simple apps, all of the GUI coding is effectively removed from the project -- all that's needed is writing the callbacks.
  • by Anonymous Coward
    Not completely off-topic: Try using GLUI, a GUI toolkit built on top of OpenGL/GLUT. You can write a program that runs portably on Linux/Windows/Mac/SGI/... (?!!?). http://www.cs.unc.edu/~rademach/glui
  • by Anonymous Coward
    If I understand correctly, what you are asking for is a C++ wrapper library that is sufficiently high level to encapsulate just about any GUI/widget toolkit around, Gtk+ and Qt in particular. Plus you want a high level common interface to the features provided by KDE & Gnome that are independent of GUI/widget toolkits. That's a difficult request. There are C++ wrappers for Gtk+ that could serve as a basis for creating high level unified widgets. However, Gtk+ and Qt use different mechanisms for handling events, so it would be quite difficult to create common routines for event handling without eliminating a lot of the flexibility and features each toolkit offers. After creating a library that sufficiently encapsulates both toolkits, you will need to create another library to provide the services of the desktop environment. In particular, you'll need a library to cover the differences in Corba implementations, window manager integration, etc. It could be done, but it won't be trivial. Also, it will add extra layers of crud slowing your application down.

    At this point in the desktop wars, I suggest that you choose one platform and separate all of your code that deals with the GUI toolkit, window manager, Corba, drag-n-drop, etc. into a separate class library. That way, you can always re-implement those classes if you switch environments.
  • by Anonymous Coward
    This doesn't really answer your question but it's a soapbox I've been on forever.

    If you write the app (I mean the meat of it, not the flashy stuff) such that the gui for the thing is not implicitly assumed to be so and so toolkit, etc. then you achieve a great deal more portability.

    Take a generic calendar app: the logic for manipulating time, adding/deleting events, etc. exists in one code base. The gui code exists somewhere else. The gui code both drives the app and displays changes in state. In this application the non-gui code is the model and the gui code is the view/controller. Changing guis afterwards would be (much) easier.

    There used to be a time when unix apps were command line first with maybe a gui slapped on afterwards. This was good because the apps in question could be scripted (e.g. integrated into a bash script). The gui would be for human use only.

    I'm not suggesting that all apps be written such that they are unable to directly manipulate their gui aspect; some apps are inherently graphical (Gimp, ee, etc.). What I am suggesting is that this approach to program architecture is better and is applicable to more than just gui/domain separation.

    BTW, in case you are unaware, this MVC stuff is old and very well proven (Smalltalk-80) and seems to be making a comeback with Java Swing.

    Of course Gnome and KDE offer more than just gui frameworks but the lesson remains the same.

    Sincerely,

    an aging Smalltalk bigot

  • by Anonymous Coward
    Dr. Tom's question is a very pertinent one. Linux is falling down in a bad way on the desktop due to the plethora of UI's being used in appliactions and the absence of standards. The appeal of the Mac and Windows desktop is that drag and drop, cut and paste, menus, etc. work consistently. When you get to Linux nearly every app is using different UI standards and conventions. Allowance for UI innovation is a really good thing but total chaos where every application has a completely different UI is fundementally bad. Its also a severe drag on Linux application development that every new application development team has to spend large amounts of time tearing themselves up between Qt, GTK, FLTK, Amber, and between C and C++ and between KDE and Gnome. The Mac and Windows developer doesn't have this divisive problem or at least its much less severe. At the same time there is a lot of programming time and talent spent developing the same functionality between KDE, Gnome, Qt and GTK. Its a waste doing everyting twice and spending time trying to make the two implementation cooperate. There is something to be said for competition but I doubt that the competition between Qt and GTK is beneficial to the community any more. I've heard rumour that GTK and Qt might be working to interoperate with drag and drop but the last time I tried it they simply didn't. To have a creditable desktop you need to have all the MIME types consistently implemented so, for example, dragging an image from a desktop browser, whether it be Gnome or KDE, into an app that handles images works right. Last time I looked Qt had far and away the best drag and drop implementation. It was best because it was very easy to understand and implement. GTK wasn't. GTK and GTK in Gimp was barely hanging together as far as drag and drop goes. All of the burden was placed on the programmer and there was too much opportunity to diverge from consistent behavior. The same thing can be said for cut and paste. It has to be consitently implemented in all apps with maximum ability to cut something in one app and paste it in another. The best way to acheive these goals is one consitent API that hides much of the complexity from the programmer and encourages them to implement a standards conforming UI. I wont weigh in if its GTK or Qt since this is a religious war between the C and C++ camps. This is not a question of whether an app runs if its using Qt or Gnome and running on Gnome or KDE. Its a question of whether the user is getting a predictable and productive experience from all the apps they use on their desktop.
  • Well, wxWindows is a pretty cool library, and it's GNU (well, the author made some slight optional modifications to the licence to make it sort of a mix of LGPL/BSD).

    Coding in C++ is much cleaner and wxWindows generates code for GTK+, QT, Motif, Windows, Mac, and ports are in progress (I think) for BeOS. Sure, it doesn't support Gnome (as a desktop), but it's a great step in the good direction, maybe Gnome support will come later if it's possible.

    Another cool thing about wxWindows is that the syntax is very familiar to MFC, so Windows applications could be very easily ported to the world. I know this isn't happening right now, and I don't understand why wxWindows doesn't have that much visibility. (fear of C++? Unstable? Please correct me.)

    Matt
  • Currently, I've yet to see the first fully cross-platform toolkit. The problem with the current toolkits is that they emulate one environment on the other, which give the feel you're using an emulator. Some important differences:
    • MacOS and NeXTstep use a separate menu bar, which means you can have applications without windows; X based toolkits attach the menu bar to every window and Windows uses a strange hack called MDI (a window in a window).
    • On MacOS/NeXTstep, usefull names are used for buttons while on Windows, it's limited to 'Ok', 'Cancel', 'Yes' and 'No'. This is especially visible in message boxes.
    • In MacOS/NeXTstep dialogs, the default button is the rightmost one, and 'harmfull' buttons are clearly separated from 'harmless' buttons; in Windows, those buttons are put together and the default one is usually the leftmost one.
    • For binary menu items, MacOS uses a change in the name (like Show Ruler/Hide Ruler) while Windows typically uses a check mark
    • Windows interfaces heavily make use of toolbars, MacOS doesn't.
    • Different vocabulary (e.g. Exit vs Quit)
    • Different menu layout (e.g. the position of the About item)
    • ...
    If you add the OpenLook interface, it gets even worse ('Close' in OpenLook means 'Minimize' in Windows; 'Quit' in OpenLook means 'Close' in Windows...)
  • Well, you can write programs in either GTK or Qt and both KDE and GNOME will have no problem running them. However, to take advantage of the special functionality of the desktop environment requires you to code for that desktop's specs. You can use any toolkit you want, but your "made for KDE" program won't work as well under GNOME unless you use a bunch of #define's to provide the equivalent functionality (and write all the relevant sections twice, once for each environment). That could quickly get tedious.

    Hopefully they'll get their acts together soon. Until then, I'd recommend not writing for either one.
  • Really. That's probably the solution you are looking for. There is a specific abstraction pattern that could easily do what you are talking about--they actually use X toolkits as an example. :-)

    Of course, that's assuming you use C++. You could do it in C, but I wouldn't recommend it. Trying to apply the Design Patterns to a non-object oriented language (no flames, please) is difficult unless you really know both OOP and C. But if you are writing for Qt, you are probably using C++ anyways.

    I can't remember the DP name: I thought it was an Abstract Factory or a Prototype.


    "Doubt your doubts and believe your beliefs."
  • The GUI architectures are, indeed, quite different in what they do. That suggests that having the same GUI code is not terribly realistic.

    There are, however, ample other opportunities for other aspects of interoperability that generally have merit.

    • Data formats

      Many UNIX applications have traditionally used data formats as a mechanism for interoperability. Many applications know how to read things like mail and news spools, which provides interoperability.

      GNOME and KDE both make fairly extensive use of XML, [hex.net] which may, with some cooperation on DTDs, provide opportunities to interoperate in a cooperative manner.

    • Protocols

      One of the traditional strengths of UNIX has been the use of common sorts of protocols. The IETF [ietf.org] has been involved in defining common protocols for things like news [hex.net] and mail [hex.net] that allow diverse mail and news servers/clients to interoperate. And just look at how many web server implementations there are out there...

      GNOME and KDE both include CORBA [hex.net] implementations that represent a well-defined, intentionally-interoperable way of defining protocols for client/server applications.

      The use of this approach requires splitting applications into "client/front end" portions, which may be GUI-specific, and "server side" portions, which should be designed to be altogether independent of the GUI.

    In effect, people should be doing design efforts to build useful "services" that are entirely GUI-independent; that will provide code that will be usable with both GNOME and KDE.

  • Look at CDE Price List [opengroup.org] and Motif Price List.

    I'd guesstimate that the cost of CDE is on the (binary) order of $150/seat; this could readily vary between $80 and $200 based on how the terms are interpreted.

    On 10 million Linux users, the mass adoption of CDE would result in a Linux distribution having $0 in licensing fees for Linux, and something around $150 for CDE/Motif licensing fees.

    • Much griping took place over the relatively low licensing fees The Open Group tried to apply to X11R6.4.
    • Tremendous flaming has taken place over the licensing of Qt, where deployment is royalty-free, but developer licenses could cost as much as about $1500.

    I can't imagine the flame wars that would come out of trying to cope with the per-user package licensing fees that are associated with CDE.

    If KDE and GNOME are "divisive," CDE is not "inclusive." It is, instead, exclusive.

  • That is my strategy. I write my application as a library, with no user interface. This means it can be easily added into other applications, and that it can have many different front-ends. Each front-end is a main() program, which links your application library and some UI library (Gtk, Qt, curses). It makes it easier to divide work, as different people can be responsible for each front-end.
  • I'm not sure why flamebait got a score of 4.
  • It depends on what functionality you need.

    Do you need DND support? Sorry, for now, it's one or the other. That will change Real Soon Now.

    Do you need for your app to dock onto each of the panels that the projects have? I seem to think that both use some kinda funky proprietary extension...you'd have to check it out.

    If you're just wanting to write an editor, tho, or just some app that's independent of proprietary drag-and-drop and all that, you could just use Any Old Tool Kit(TM).
  • AFAIK, there are no abstraction layers. However, there are some tricks you could use to effectively write something that'll run on both.

    1) You could write the code in a way that takes out the toolkit-specific stuff, and puts that in a seperate dynamically-linked library. Then, just write two such libraries - one for Gnome, the other for KDE. Install the appropriate .so for the system you're using.

    2) Conditional execution. This comes in VERY handy at times like this, but is a bit messy. Again, you have one binary that'll run anywhere, but this time you'd need both toolkits installed, as you'd have to link the main binary to both.

    3) #ifdef specific code. This avoids needing both toolkits, is slightly tidier to write, and avoids the complex contortions needed to isolate toolkit specific code. Unfortunately, you'd then need to compile two binaries, and you're only marginally better off than if you'd two seperate applications.

  • Obviously they're both event driven systems (hey, they're GUI apps), but two issues come to mind immediately:

    1) Qt is C++-based, Gtk+ is of course a C-based toolkit. Consequently, unless you do some spiffy stuff with opaque data structures, you'll have to expose C++ in the headers of your cross UI toolkit.
    2) Gtk+ is *completely* callback driven--there are no blocking calls for UI stuff--this boggles the minds of people who want to do MessagBox() style calls. If Qt has blocking calls like that, you'll have to hack fun stuff like GnomeDialog blocking calls into your UI toolkit for Gtk.

    Also worth mentioning is UI bindings... does Qt have anything other than C++ support? With Gtk+, you get Ada, Perl, Python, etc..., so I assume this would be a C++ only toolkit.

    Etc., I'm rambling at this point...
  • You can't compile Gnome without gtk, you can't compile kde without qt. If that is not "requires" then I don't know what dictionary you are using :)
  • True - it's very easy to run an application from one under the other.

    However, in the case you mentioned, you are running an app written for KDE under gnome. It will not take advantage of any special features gnome apps may have under the gnome desktop.

    To do so the app would have to be specifically written to do so. But if you wrote it for Gnome, then it wouldn't take advantage of KDE stuff. Or you could write it for both, requiring both to be installed, and then somehow figure out which desktop is running and morph.

    And then there is the whole look/feel issue.

    What was asked is if there is a middle ground that would satisfy both - something like AddIconToDesktop which would add make the appropriate API call to either KDE or Gnome.

    This has always been the problem with X. Be it simpler toolkits or entire desktop systems, there are just too many choices - be it good or bad.
  • Isn't this *exactly* the situation Java's supposed to be for? GNOME, KDE, NT, who cares?

    Of course, if you're using the flashy uber-cool stuff, then you're going to have to get specific, but if you're just trying to *do* something, it seems like Java ought to be the answer.

    Okay, so there's the little issue of an efficient Virtual Machine for linux. Details, details..

    Zipwow
  • I would recommend wxWindows for this. The big negative to this is that wxWindows is not _yet_ ported to Qt and GTK; however, both ports are ongoing. The Curses port is also ongoing (although unlike the others, its status is uncertain). (I want that Curses port!!)

    It does work on Motif, Lesstif, Xt, and GTK, so it'll run on just about every Linux box. It also works on Windows, and a Mac port is underway.

    Also, it's been ported to a scripting language -- Python's implementation is an almost direct echo of its C++ version, to make it easier to transfer knowledge.

    BTW, I've never used MFC, but I've heard that wxWindows isn't anything like that. Yet some people here are saying that it's similar. Is that true?

    -Billy
  • What I'm about to say may be offtopic for the general discussion, but I am quite interested in this thread.

    I like apps that use the web, rather than apps you access from the web.

    Embedding browser controls in apps, wether they be written using MFC, GTK, Qt, Swing or even Borland's VCL mean that you can have the best of both worlds.

    You need not give away any of the cool bells and whistles that come with your favourite lib and you can also tie your app to regularly and easily updated data on the web.

    MS Money is a great example of this, especially when you run it on a dedicated net connection, without all the hassles of dialup etc.



    -------------------------------------------------- -----
  • I use wxWindows from Python and love it. It's not quite as cross-platform as you say (if anyone's working on a Qt port, they're being quiet about it, and IIRC the the Mac version is rather early in development), but it's still better than just about any GUI lib out there. I think a cross-platform library is not as appealing in C++, since it still has to be recompiled for each platform. wxWindows is however gaining a foothold in the Python community, where an app can run on any platform where the wxPython libraries have been ported with no extra recompilation required.

    As for the Gnome support, the wx people would love to add it, but last time this came up on gnome-devel-list, the gnome folks weren't too keen on the idea. It's not currently possible to make a full-fledged Gnome app (whatever that means) with wxWindows, but you can come as close as you can with plain GTK (no libgnome/libgnomeui)
  • Why Don't you go tell Sun that Star Portal can't work. Tell them that you graduated from MIT and you know better.

    And what about a web based mp3 player? Couldn't they store all the mp3 files on the server and stream to your local machine, saving you from having to find all the mp3s you want and archiving them yourself. Are you trying to say that Netscape doesn't have access to your sound card?

    Try reading Tim O'reilly's new article on MS vs. Linux.
    Joseph Elwell.
  • by jelwell ( 2152 ) on Monday October 04, 1999 @11:43AM (#1639517)
    I think this post is flaimebait. I'd like to moderate it down one point, thank you.

    But seriously, it seems that in order to standardize gui development between the two managers one would have to create a markup language for displaying. We could call it AML (for Application Markup Language). Then we would just need a powerful event driven scripting language - call it lavascript (for Linux Application Visual Access Scripting Language). At this point *real* processing could be done through a network connection - even routed to localhost. Via a networking protocol (call it TCP/IP) and it could connect to CGI servers to do the processing. oh wait. screw it.

    sub isWar
    {
    my($enemy1, $enemy2) =@_;
    if($enemy1 != $enemy2)
    {
    return 0;
    }
    return 1;
    }

    sub flameproof
    {
    `echo @_ | /dev/null`;
    }
    while (&isWar(kde, gnome))
    {
    &flameproof("Joseph Elwell");
    }
  • Both desktop environments claim toolkit-agnosticity (Gnome prefers GTK, KDE prefers Qt, but neither one requires a specific toolkit). The problem, of course, is that you'll have to write a lot of things twice and use #defines to figure out which to use.

    I wonder if there's an abstraction toolkit in the works which could compile for either environment (sort of like wxWindows for desktop environments instead of operating systems)?
  • Embrace and extend?

    --

  • The poster stated you could write, for example, a GNOME app with non-GTK+ widget sets. But as I pointed out, a GNOME app by definition must be written in GTK+. I never said that you couldn't run non-GTK+ apps in GNOME. They just aren't GNOME apps!

    PS. Thanks for calling me names. As I have in the past, I guess I'm falling to your level in this sentence, you shit-for-brains ass-monkey.
  • GNOME and KDE both *require* GTK+ and Qt, respectively, for all graphical apps.

    From the Gnome FAQ:

    "GNOME uses the Gimp Tool Kit (GTK+) as the graphics toolkit for all graphical applications."

    I think this is in the KDE FAQ, too, I didn't have time to track the passage down, though.
  • easy, you go to the URL. do whatever the app is supposed to do. save locally. like in hotmail how you can upload an attachment? saving works too. why couldn't a basic word processor work that way (in theory, forget about shitty browsers for the moment)? you don't HAVE to save your data on a server, you just use the app served to you to do the work and then save locally or remotely. whatever you need.

    that's how it works. whether that fits your situation or not is another question.

    -l
  • I'd be more interested in making Gnome programs compile on a system with just the Gtk+/glib libraries installed, without requiring any of the other Gnome libs. And similarily, being able to run KDE apps with just Qt installed.

    My experience has been that trying to compile programs written for Gnome on a system with just Gtk/glib never works without removing the dependencies on gnome libs in the code yourself. Often, I find that it isn't that hard. I get the feeling that Gnome developers could care less about those that don't run gnome.

    People running old systems, especially laptops, can't really be required to bear all the overhead of running Gnome or KDE just to be able to run one or two programs.

    It would also solve, at least partially, the original Ask Slashdot question of how to write apps for both KDE and Gnome--just find the greatest common denominator, which is to make them compile with just the toolkits.

  • ...but it doesn't seem to be the point he thought he was making.
    Actually, he understood my point perfectly.
    ...and set up a "configure" option to control whether to use GNOME stuff
    ...and that's exactly what I'd like to see. There are many applications targeted to run on Gnome systems and using gnome libraries (in short, Gnome apps), that could quite easily be made to run with just Gtk+, perhaps with a slight loss of functionality. With that little added effort, the program gains more users--both KDE and otherwise, and I and others don't have to duplicate the effort of modifying code (and yes I do send patches for what I do).
  • Yeah, it'd be nice to see both systems interoperate a LOT better.

    On my K6-233 RH6.0 system, using the KDE desktop, it takes up to fifteen minutes for a GTK app to show up on the desktop. The system's a vanilla "workstation" load! Where's that at?
  • I just came across this while chasing CVS clients...

    Arachne [arachne.org]

    Kinda free, promised to be GPL'd Real Soon Now, and targeted to Mac/X11/Win... tho the Win part seems to be win3.1

    fwiw
  • REAL apps that run over the net

    Define "run over the net". Are we talking about, in effect, time-sharing, in which all the apps run on a server machine, and all interaction with them takes place via a browser?

    If so, is it ipso facto the case that all applications

    1. can be made to run in that fashion;
    2. would work as well as, or better than, those not made to run in that fashion?

    Note that citing some applications that can run in that fashion, or even that run better in that fashion, doesn't at all demonstrate either that all apps can, or should, be made to run in that fashion.

  • I'd be more interested in making Gnome programs compile on a system with just the Gtk+/glib libraries installed,

    Given that a "GNOME program" is a program using GNOME facilities, how would compiling a GNOME program be possible on a system without the GNOME libraries and headers? That sounds sort of like wanting to be able to compile GTK+ programs without the GTK+/GLib libraries installed, or to compile X programs without the X libraries installed, or non-GUI programs without "libc" installed, or any programs without a compiler installed....

    It sounds as if what you want are GTK+ programs (or Qt programs), not GNOME (or KDE) programs. Such programs do exist; to achieve the goal you want, you presumably want to encourage people to write more such programs.

  • Just out of curiousity, how would a "Web-based" word processor, or spreadsheet, or image editing program, or network packet capture and analysis program, or MP3 player program, or... work?

  • (acually, I was thinking about how the world needs a calendar/scheduling/intranet -type program that's cross-platform, instead of the Exchange/Bloatus Notes that exists right now), and though "what about a server-based app that used the browser for display."

    Is Yahoo Calendar [yahoo.com] such an application?

  • the Motif standard and the X standard that came along afterwards.

    To which "X standard" are you referring? Xdnd is being adopted by at least three tookits, as far as I know (JX [caltech.edu], where I think it originated; GTK+, which implements it in 1.2; Qt implemented it either in a late 1.4 release or 2.0, as I remember), but I don't think it's an Official X Consortium^H^H^H^H^H^H^H^H^H^H^H^HOpen Group^H^H^H^H^H^H^H^H^H^HX.org standard, as far as I know. Has it been adopted by X.org?

    Both teams are working on interoperability

    I think GTK+ 1.2 also implements the Motif drag-and-drop protocol (which may explain why dropping from the Motif-based Netscape to the GTK+-based GMC worked); what are Troll Tech's and/or the KDE team's plans to implement the Motif DnD protocol?

  • The web is the interface.

    The interface to everything? A Web browser can replace all the stuff in KOffice, can replace the GIMP, can replace XMMS, can replace Ethereal, can replace....?

    Yes, there are a lot of applications that can work as client-server Web apps; I have yet to see anything even remotely resembling solid evidence that all applications can be recast in that fashion.

  • easy, you go to the URL. do whatever the app is supposed to do. save locally.

    Err, umm, go to which URL? The URL for the object being edited by the word processor, spreadsheet, image editing program, etc.? If so, how is this anything more than allowing URLs, not just file names, in a "File/Open" dialog box or in the app's command line? I'd hardly call that particularly "Web-centric" - you're still writing the app, you just write it so it can use HTTP to read and write files (isn't that something that many KDE apps can already do?).

    And who "does whatever the app is supposed to do"? A program running on your machine - i.e., an app running on your machine, just as in that boring nasty old pre-Web-centric universe - or something running elsewhere - in which case how does it interact with you?

    you don't HAVE to save your data on a server, you just use the app served to you to do the work and then save locally or remotely.

    OK, what makes writing "the app served to you" "writing for the WEB"? If all that happened was that you got some Java app served to you, and it's running locally, perhaps reading local files, and saving the file locally, you haven't "written for the WEB", you've chosen Java/AWT or Java/Swing or whatever, rather than choosing KDE or GNOME or CDE or whatever.

    And what if the application is the MP3 player I mentioned? How exactly do you "write that for the Web", other than writing it as a browser plug-in - but, as far as I know, browser plug-ins are cross-platform (unless browsers support Java plugins, but, in that case, see my previous comment about Java apps)?

  • Well, he has a point.

    ...but it doesn't seem to be the point he thought he was making. He asked for "GNOME apps that don't require GNOME"; what it sounds as if he really wants are "non-GNOME GTK+ apps".

    In most cases it would be sensible to make GNOME linking a compile-time option, if you use it at all.

    Unfortunately "sensible" doesn't necessarily mean "easy"; somebody could rely on GNOME's libraries to handle a lot of things, and would have to re-implement those things and set up a "configure" option to control whether to use GNOME stuff or the app's private stuff. Perhaps they should do that, but it might require them to do more work.

  • I thought that I read somewhere that Netscape was going to use GTK in future versions anyway.

    I think they're using it as the UNIX toolkit for Mozilla, but that doesn't handle the DnD problem unless you run Netscape 5.0 or whatever Mozilla-derived release they put out (or run Mozilla).

  • Why Don't you go tell Sun that Star Portal can't work.

    Because, according to this press release [sun.com], StarPortal isn't the sort of "Web-based application" the original poster was citing as a reason why we should all "forget about toolkits". It says

    Completing development of StarPortal, a web-based version of the office suite that combines a Java(TM)-based client with the software to enable browser access to office productivity tools.

    which appear to be saying it's an application written in Java (see earlier comments in which I note that a Java-based application is just an application written for Java plus some widget set, just as a GNOME application is written in C or C++ or whatever plus GTK+ and a KDE application is written in C++ or whatever plus Qt), not a "web-based application" where you just fill in forms and hit "Submit", as the Web calendar and mail applications some people mentioned are.

    Yeah, maybe it's more cross-platform than, say, a UNIX+KDE or UNIX+GNOME application is, but it's not the same sort of application as is, say, Slashdot, that being an example that one of the people to whom I replied gave.

    And what about a web based mp3 player? Couldn't they store all the mp3 files on the server and stream to your local machine, saving you from having to find all the mp3s you want and archiving them yourself.

    Again, that's not a "Web-based application" any more than an MP3 player that can read files somehow magically becomes "NFS-based" or "CIFS-based" by reading from a file system on a server; the application is a local application, written using some toolkit - toolkits being what the person to whom I originally replied (and who cited Slashdot as an example of "Writing for the Web") said we should "forget".

    Are you trying to say that Netscape doesn't have access to your sound card?

    No - but if it's playing something itself, it's not as if somebody "wrote for the Web" - they didn't write any application at all to play MP3s, they just used an application that already existed, namely Netscape or a plug-in. If you already have a canned application to perform some function, the mere fact that the canned application happens to be part of a Web browser doesn't mean that, by using that application, you've "written for the Web", it means you haven't had to write it in the first place - that certainly means you don't have to worry about toolkits, but it doesn't help you if that's something Netscape or whatever doesn't do.

    Try reading Tim O'reilly's new article on MS vs. Linux.

    Oh, you mean this one [xml.com], which I read several days ago, where he says

    Traditional software embeds small amounts of information in a lot of software; infoware embeds small amounts of software in a lot of information. The "actions" in an infoware product are generally fairly simple: make a choice, buy or sell, enter a small amount of data, and get back a customized result.

    and

    Information interfaces are not as efficient for tasks that you do over and over as pure software interfaces, but they are far better for tasks you do only rarely, or differently each time. In particular, they are good for interfaces in which you make choices based on information presented to you. Whether you're buying a book or CD at Amazon.com, or a stock at E*Trade, the actual purchase is a fairly trivial part of the interaction. It's the quality of the information provided to help you make a decision that forms the heart of the application you interact with.

    where he pretty clearly indicates that he does not think that all traditional applications are dead and that CGI scripts will replace them, he indicates that there's a whole pile of new applications for doing new things that are best done with browsers talking to Web servers.

    The problem that some people have is that, as, if I remember correctly, Abraham Maslow said, "to somebody whose only tool is a hammer, the whole world looks like a nail". Web-based applications, in the "3270 for the '90s" sense (as somebody described Web stuff several years ago), are cool - but they're not the whole world.

    Try reading the original poster's article [slashdot.org], which said

    Forget toolkits. Linux-only development is a dead-end. Write for the web and maybe you'll make some bucks like CmdrTaco and Jerry Yang.

    (without, it appears, bothering to ask what application the submitter of the question was trying to write).

    Writing a custom GUI application to do Internet shopping, or calendar management, or library card catalog searching, might be a dumb thing to do now that we have HTTP servers and clients all over the place (although I'm not about to boldly declare that it is foolish; there may well be reasons why some particular such application makes more sense than a CGI script as a solution for some particular problem); nobody's made a convincing case that writing GUI applications in general is no longer necessary now that we have the Web.

  • Do you care how well it works

    Yes, at least up to a point; if it works too poorly, what's the point?

    & does java applet based systems count?

    No. A Java applet is just a small locally-run application that happens to be written in Java rather than in some other language (or, perhaps, "that happens to be distributed in the form of Java bytecode" - something distributed in Java bytecode form wasn't necessarily written in Java, as there exist compilers that translate other languages into Java bytecodes, e.g. the JPython [jpython.org] compiler) and that happens to use whatever toolkit the environment in which it's running provides. Interesting, potentially cross-platform (if you don't manage to use some platform-specific classes, say), but not the same as the examples many people were giving, e.g. Slashdot or Web mail and calendar systems, wherein "the web is the interface" - if your browser happens to pop up some Java applet that handles input events, I/O, etc. itself and provides its own UI with its own code, the Web isn't the interface, it's just the pipe over which the code for that application was delivered, and perhaps the pipe over which it talks to some server, but if that's sufficient to make the Web the interface, a boring old "widget-centric/shrink-wrap" application downloaded via HTTP "makes the Web the interface" as long as it includes HTTP client code that it uses for some operations.

    (Besides, I rather doubt you can make a "Java applet-based" version of the GIMP, or of the other applications/suites I mentioined, for one simple reason - by the time you're done, it'll probably be too big to be called an "applet". "Applet" isn't short for "application written in Java" or "application delivered as Java bytecodes"; the "let" part is a diminutive, indicating that it has to be a small application before it gets to be called an "applet".)

  • by Guy Harris ( 3803 ) <guy@alum.mit.edu> on Monday October 04, 1999 @02:40PM (#1639538)
    Think past the Linux box

    KDE seems to run fine on my FreeBSD partition; I installed the 1.1.2 binary package a few days ago. Solaris binary packages also exist; people probably run versions from source built on other OSes as well.

    Note that the KDE home page [kde.org] says:

    KDE is a powerful graphical desktop environment for Unix workstations. It combines ease of use, contemporary functionality and outstanding graphical design with the technological superiority of the Unix operating system.

    Note the lack of a certain word beginning with capital "L" in that; they're not targeting Linux, they're targeting UNIX-flavored OSes, including but not limited to Linux.

    The GNOME site doesn't say "not for Linux only" on the home page, but the "What is GNOME" part of the GNOME FAQ [gnome.org] says nothing about it being targeted only for Linux, and the "What are the system requirements for GNOME" part [gnome.org] says

    Currently, you need a machine with Unix or a Unix-like operating system installed, with the X Window System (X11R5 or later).

    Again, note the use of the U word rather than the L word.

    You're probably unlikely to get as much enthusiasm from free software developers for CDE as there is for KDE and GNOME until there's a free CDE implementation (speech, not just beer) - there's LessTif, but it's just a Motif implementation, not a full CDE implementation.

  • As one of the main coders on the Gtk-- project I am always glad to get feedback whether I agree with it or not. You said that gtk-- was currently as slow as hell. I was wondering which version in perticular you tested. Was it the stable version or the development version?

    The development version should be considerably faster as all the hash table lookups were eliminated and all the excess size (often many K) of signal stuffs has been eleminated. If you still find it slow (compared to gtk+ as I can't fix stuff outside my layer), please send me a demo program and I will mark it as a hot spot to do optimization. Thanks in advance.

    --Karl

  • There may be some problems doing that. Most notably the signal system libraries between Gtk-- and Qt are not compatable, nor can they coexist easily. Qt does not properly respect namespaces and thus wipes out names used by the other. This forces the user to have to chose to use the Gtk-- signal system or not. (Gtk-- signal system is now seperate from Gtk-- as Libsigc++ so that it can be used for such cross toolkit uses.) Libsigc++ does avoid the Qt keywords when it detects them, but it does degrade use slightly. (Apparently Qt was granted sole license of the word "emit" even though I can't find it in any standard. ;-)

    If you could comment more on what you find annoying about programming in Gtk--, I would be glad to hear it. We are working to complete version 1.2 very soon now with improved speed, features, and documentation. Any feedback would be greatly appreciated.

    --Karl

  • Hey, thats imposible!
    You may have some trouble with your DNS, some
    sort of timeout.
    Do nslookup 'your.hostname' work?

    Oliver
  • These widgets are Gtk wrappers.
  • RMS has aknowledged that the QPL might fit the wording, but not the spirit of free.
    I recently read a mail by RMS on the WindowMaker list were he pointed out that using Qt was not advised behaviour due to the licensing issue.

    As for ESR he will testify that anything is free as long as he gets his name on print.

    Since I, and obviously others don't think it is free, "everyone" definetly don't think Qt is free.
  • Yeah, what the first poster said :) I run KDE on my home PC, and Gnome (Enlightenment) on my work PC, and run the same programs on both of them with very few differences that I can see.

    The apps should look the same. You will just have to work around not having the 'features' of the various Windowmanagers.

    IIRC, the GNOME/KDE people were starting to get together on making their features intercompatible...the first feature to come ofer is/was supposed to be drag-n-drop, and I think I read the article on here a long time ago.

  • Hrm, I don't necessarily agree. For one, um - why'd you skip the dial-up step for standalone? :)

    But anyway, I've actually been thinking about doing something like this. I'd like to make a gradebook application for Linux, and I've been thinking about how to implement it. I've considered using a web front-end, that way folks on macs, linux, windows, or palm pilots can access it. If it's on a LAN, it'd work well. I don't plan to put banner ads in my app. :)
  • hmm... actually that's an interesting thought.

    However, I don't think it's true. For one why would one desktop enviroment want to kill another one? There is no money reward.

    And I have yet to find an example of embrace and extend -- although I do see desktop enviroments starting to realize that apps that aren't your native toolkit/libs, still deserve a home in your desktop project. GNOME uses Netscape extensively in it's desktop -- yet I don't see the anybody trying to lock you into a particuluar piece of software -- but more like allowing you to use more apps with your desktop enviroment of choice.
  • It's hasn't started with KDE 2.0. Ever since KDE 1.1 and later KDE teams have been creating ways for non-KDE apps to work better with KDE, such as using cross-theming (to at least try to match widgit colors the best as possible). Currently that supports apps using tk's gui librarys (wish), Netscape, Motif apps, and athoen widgits. So basically every Linux X11 app (excluding those written in gtk+) is color themed automatically by KDE 1.1.x (if you choose the cross-theming option in kcontrol). This is a good thing. It for one makes applications look / feel more consistant, and finally it makes those nice themes look even nicer.

    And yes, KDE 2.0 will include tools for converting KDE widgit themes to GTK+ and vise-versa. Mosfet is currently working on this feature, along with the KDE widgit theme designer (finally fast, and useful themes).

    I am not sure if GNOME will support similar features in the 2.0 release, but I sure hope they will -- It just makes Linux feel so much more intergrated and useful, even if it's real benfit is little.

    As for other standards, both the GNOME and KDE parties are working togther. Both sides are working hard to choose the same audio server for compatiblity between various apps. The same can be said about window manger hints -- both want to use the same set of hints, which should be fully documented as part of the Window Manger Spec 2.0. So any Window Manger compatible with Window Manger Spec 2.0 should be able to work fully with both desktop enviroments, and settings for the window manger should be fully embedable in the main control panel of the desktop enviroment. Finally, for release 2.0, both desktop enviroments have agreed on a common drag and drop protocol -- xdnd.

    Well... that's how it's suppost to work in theroy. Lets hope it does.
  • When I get into a situation like this, I write my own level of abstraction.

    Make your own functions to create objects. To draw a button create your own function. When you call that function, depending on what library you are using, that function calls the toolkit function to draw a button.

    This method adds overhead to function calls. But then again, you can 'port' to whatever library/toolkit you want.

    I actually stole this idea, in a sense, from reading about the TCP/IP stack and how layer N can only 'talk to' (read call functions in) layer N+1.

    The whole idea behind this is portability; as your program structure changes, it only changes in the layer you are working in and you don't have to rewrite your whole program. Therefore, if you substitute KDE for GTK or vice versa, you only have to change the functions that access the toolkit API.

    I bet there is some official name and technique to this if you go to structured programming school.

  • I dont think that's a new idea, I have been doing things that way for years, anyway. Its a pretty basic concept, making basically a GUI abstration layer to seperate your code from the GUI code. An even better way to do this would to put your widget drawing routines into libraries that can be dynamically loaded so you can have an application that can work on any toolkit without recompiling and without having to always have both tookits installed. With this method, your program could be made to work fairly easily with any new standards that come out too, just make new GUI "drivers". The only problem with this method is that you would probably have to rewrite a fair bit of code for each toolkit, but for full integration into both KDE and GNOME, thats pretty much inevitable anyway.

    A lot of 3D games that use multiple renderers do something like this, Quake II is a good example, you ahve your quake II binary + a few libraries for different renderers, reg_soft.so for software rendering, ref_gl.so for Mesa/OGL rendering, ref_3dfxgl.so for 3DFX OpenGL rendering (links to Glide), and ref_glx.so for Mesa/OGL under X instead of SVGAlib.
  • Well, I'm definately no expert on GUI programming using Qt or GTK+, but I have an idea you may have heard, and may like.

    You could write the program in such a way that it uses libgmodule's modules (from glib) and call your own custom written generic functions to create the windows you need, which will use widget toolkit specific functions from a number of modules. I.E. you could have a module for GTK, and one for Qt, and one for Lesstif or whatnot. You just have the program load a module based on a command line option, or a default, and then it will, say based on a variable's contents, extract the correct symbols for the widget specific functions from the modules.

    If you're confused, I'm sorry, but I'm not sure how much clearer I can make this.

    --
    Gabe Ricard
  • X.F.C.

    (The X Foundation Classes)

    :)


    /me runs away

  • You could write your apps in such a way that the UI is seperated from the non-UI code, then you'd only need to redo the UI ( there is no way around this AFAIK )

    One issue is that the two toolkits use different languages though. This could make it less than easy.

  • I do second that.

    It would also be possible to have database forms and views that adapt to the current desktop, using the XML tags stored in the database.
    At least for simpler, not performance-critical GUIs this is an option.

    Just, as the above poster said, find someone to write it ;-)

    ---
  • it can be a very sensible design decision *not* to use cookies. for a public site where you want users to like your service, and be able to enjoy it with a large range of browsers and settings, depending on cookies is arguably a bad idea. there are other ways (i.e forms with image submit buttons, or session data or session id's embedded in the urls).
  • I haven't worked with, nor have I looked at the API, but I wonder if its possible for libglade to generate QT widgets instead of GTK+ widgets at runtime. That would be incredible. Imagine, your whole interface is defined in XML, and parsed at runtime. Your desktop environment is detected by libglade and the appropriate QT/GTK+ gui is created.

    What do you think?

    Lee
  • That is the most idiotic thing I've ever heard.

    Why do you suppose Win95 is so unstable? Why do you suppose the only way to fix it when it breaks is to reinstall from scratch? The registry makes the system nontransparent and creates a single shared point of failure that can (and regularly does) invalidate the entire system, simply because one program screwed up.

    The day that Linux gets a registry will be the day I switch to a different OS.

    Consciousness is not what it thinks it is
    Thought exists only as an abstraction
  • Just a thought:

    If you were to plan your app carefully, you should be able to seperate out the core of the application from the environment specific portions. While you would have to write some code twice, in the end you would have a program that takes advantage of the functions and capabilities of both environments.

    /Zl
  • Abstraction.
  • Perl/TK, TCL/TK, and I wouldn't be surprised if there's a Python/TK.
  • If you're just trying to *do* something, you can run KDE apps with the GNOME environment, and such, perfectly easily.

    The only thing you can't do, is conveniently write an app that takes advantage of the advanced features of both GNOME and KDE.

    This has little to do with what language you use, as GNOME's core is in C, and KDE's core is in C++.
  • You might prefer GTk and that's fine with me but after checking out GTk and working with Motif and Win32 API for long time I can assure you that QT is quite amazing.
  • The trick is to find an API that works across toolkits. Check out wxWindows at:

    http://web.ukonline.co.uk/julian.smart /wxwin [ukonline.co.uk]

    It currently supports several OS's -- Windows, Linux/GTK, BeOS, with ports to Mac, Linux/QT coming along. There are plans for a RAD application designer in the works, as well.

    -- Ken
  • http://www.wxwindows.org [wxwindows.org]

    This actually redirects you to some faster url in the UK i think.
  • From the end users point of view this would be my main question. Personally i run KDE1.1.2 but use quite a lot of gtk apps. Your app shouldnt be integrated for a DE unless it absolutely has to be. This way users of other environments beside KDE/GNOME can benefit from the app. Unless you're writing something using the CORBA extensions of either DE or writing a panel applet then I would definitely advise you to write your app as a pure gtk application.

    Users of both DE's will be comfortable with a gtk app and most if not all of the major distros come with GTK 1.2X installed.

    Perhaps someday there will be a way of easily writing one piece of code with an abstraction layer that can be compiled for either DE but until then i would defintely use gtk

  • (Disclaimer: I'm more of a CLI/network driver programmer, and am new to this "Gooey" programming. I have not actually written either a GNOME or KDE app. However, this is my understanding of how the two do and don't play well together.)

    First of all, it's important to realize that GNOME applications run under KDE, and KDE applications run under GNOME. So, it's not as if writing for one means that users of the other desktop can't use your program (assuming that both GNOME and KDE are installed, of course).

    The GNOME and KDE teams are working out a common window management and session management specification. I suspect this is mostly relevant to people writing window managers and/or toolbar/pager applications, and not to your generic gApp or kApp program, however.

    That said, it's probably not possible to write a single program that is both a GTK+ and a Qt program. The best approach would be to separate the program into a non-GUI server and a GUI-based frontend, and then you could code a GTK+/GNOME frontend and a Qt/KDE frontend (or, in the true spirit of Open Source, simply code the one you want and let a partisan from the "other side" code their favorite :^) ). Since you are guaranteed that each enviroment has a CORBA ORB, making the interface between the server and the GUI based on IDL might be smart.

    Alas, Bonobo and KOM aren't really compatible object systems. Maybe in the future the teams will work out how to embed objects cross-GNOME/KDE, but don't hold your breath.

    And, if only some genius would hack Glade or libglade to work with Qt, making two separate front ends wouldn't be nearly so much work. (But I'm not genius enough to do it ...)

  • And they can be horrible.

    My brother is a web designer, and does some pretty funky DHTML and JavaScripting on his personal home page, and he spends ages cursing and debugging the JavaScript for Netscape and IE.

    If you look at the source of *any* of his pages, you'll see it has loads of

    if (ns) var = this.thing.here
    if (ie) var = another.thing.here

    One example is the previous [ziggen.com] version of his homepage [ziggen.com], which he couldn't get to work with Netscape because of a DHTML bug in it (and he is *good* at working around bugs), so he had to create a new one from scratch.


    ---
    Ilmari

  • Whenever possible, you should split your program into at least two parts: the main application logic and a client/front-end. This way, you can write a client for GNOME, a client for KDE, maybe even a Java client - whatever. The point is, you're sharing the core of the application, only rewriting what you have to, and you're doing this very cleanly. Use the GUI toolkits to do what they're designed for: GUI's. Try not to couple this too tightly with the rest of your application.
  • I agree, planning is the key.

    But take the concept one step further. There is nothing particularly Gnomish or KDEish about a PIM. Nor is there something particularly Windozish or PDAish. But the truth is there is a certain look and feel you want out of an application dependant upon the final "run time" envirnment. You can run a text based PIM under Gnome, but it sure would not be pretty.

    Plan the core code for the widest possible distribution, then produce the user interface/windows manager interface seperately.

    The day Sun gets Star Office for win freely distributed the way AOL flooded the magazine racks is the day the streets will be filled with ms blood.

    --
  • The "V" GUI applications framework [tu-berlin.de] is something that has interested me for some time (although, admittedly, I haven't put any effort into learning it -- PHP3 [php.net] is keeping me busy enough these days). It allows you to write your application to one GUI API, and have it port very easily between X, Win16, Win32, and possibly Mac as well.

    "V" is under the GPL, too...perhaps some interested coders could look into extending it to support your choice of widget libraries and other GUI environments.

  • I found it funny too, but you can't pipe to /dev/null. You have to redirect to it. It isn't an executable...

    My God! I need a life! ;-)
  • by Dr. Tom ( 23206 ) <tomh@nih.gov> on Monday October 04, 1999 @07:39PM (#1639572) Homepage
    First, thanks for the comments that have been posted so far. Second, let me repeat that this isn't about which GUI to use, this is about how to write an app that can run under any desktop (or none) and still be theme-able, drag-n-drop-able, dock-able, etc.

    So, there were several specific points made:

    • Berlin -- Seems to be a replacement for X that is highly modular, including lots of gui/desktop code. Isn't this just another environment we'd want to support?

    • wxWindows -- This contains an abstract GUI API, and several libraries that implement specific GUIs. You write your app for the abstract API. This doesn't address the problem of running under KDE or Gnome, although if the abstract GUI API can be extended to encompass desktop functionality, this might be a good place to start. The difficulty of creating one abstract API that encompasses all known desktops, GUIs, event models, themes, etc. is quite hairy, however.

    • Desktop standards -- The KDE and GNOME teams are working together to create interoperability standards such as window manager hints and so on. This is good and should continue. Is there a standard for themes?

    • Client/server model -- Write your app with a gui/desktop/window manager-independent core, and several specific frontends. This seems to be what you have to do now (and it's really just a good design policy). The amount of code that you have to rewrite is limited to the part that interfaces with the desktop environment. This part could be loaded dynamically, and possibly automatically generated. The trick of course is the API - maybe an extension of the wxWindows GUI API would be useful here.

    • Parrot/Glade/Fluid -- While not all of these were specifically mentioned, they are programs that create GUIs based on some abstract definition. These tools may evolve into something that can automatically generate the frontends mentioned above.

    So the answer is mostly "Not Yet" but the future looks bright. I hope that the various desktop environment makers can agree on some more standards that will allow apps to run anywhere, and I also applaud the efforts of those working on automatic generation of frontend modules.

    I'll be writing my app in as much of a UI-independent fashion as possible for now, and hope that the dynamically loadable GUI/Desktop Environment API is done before I am.

  • Since most (decent) distros include the libraries for both toolkits, you should be able to get it to run pretty much anywhere.

    You will miss out on the funky features of the desktop that isn't running though.

    This is really an issue that GNOME/KDE need to work out whereby the two can exist comfortable at the same time (not all the panels and applet, but the core stuff like session management, CORBA, etc.)

  • The KDE FAQ does not use the same phrasing, it says in 2.6 that KDE uses the Qt C++ crossplatform toolkit, which comes with its own license. [kde.org]
  • Really though, with as many toolkits as GNU systems seem to require, it makes sense to abstract the interface as much as possible with any major application. Instead of you application asking for a save dialogue box, it should ask for a filename. If you think about it, there are many ways to get a filename though only one way to open a dialogue box. These abstractions could be implemented using any GUI toolkit or perhaps a text interface. If I am not mistaken, Berlin is doing something like this.

    --

  • Is that what the original poster meant?

    I was thinking about this recently (acually, I was thinking about how the world needs a calendar/scheduling/intranet -type program that's cross-platform, instead of the Exchange/Bloatus Notes that exists right now), and though "what about a server-based app that used the browser for display."

    I mean, for a calendaring app (for multiple people) the data needs to be stored somewhere central, right? This becomes a "write for the web" application, but without the horrendous problems you mentioned (all of which I've encountered, BTW :o)

    The original post mentions /. and Yahoo, both of which are "apps" that run on the server, and use the browser only as an interface (no java*)

    I know that this doesn't apply to every situation, (anything that relies on interactive feedback wouldn't work) but for those that would work, it seems like the best way to make it truly cross-platform (not just cross-GUI toolkit :o)

    If you want to see something like this in action, install Roxen (GPL web-server) and play with its configuration interface. Very slick.

    Just my two cents...
  • A registry is not a bad idea just because Microsoft screwed it up once.

    A configuration database will always be faster, more reliable and easier to maintain than the current bunch of ASCII-files, given that it:

    * implements access restrictions
    * uses logging so that you can
    - undo all the changes done by a particular user/program
    - or restore the state at a given point of time
    * has an easy to read input/output format (e.g. XML)
    * can be accessed from the command line

    The Windows95 registry was a step in the right direction, but I guess whoever implemented it did not get enough time to think about making it really secure against being messed up.
  • Even if you're not following "Microsoft's turd-trail" in that regard, web-based applications often follow Microsoft's rules of speed (or lack thereof). Let's say I want to check my e-mail.

    Standalone app:
    Open up the program. The program loads. I click the "check mail" button and the mail is downloaded directly to my PC (for POP) or as needed (for IMAP). I can scroll between the messages and use various functions as necessary, knowing that the program has loaded correctly.
    HTML-based app: (assumes dial-up connection, which is the most common still)
    Dial the ISP. Wait for the connection to complete. Pull up the web browser -- it takes as much time as my e-mail program to load. Type in the URL of my mail provider. Wait for that to load. Log in. Wait for graphical pseudo-widgets to load. When I choose to view a message, wait for the message to load along with redundant controls, buttons and a banner ad or two. The entire functionality of the system hinges on the reliability of that particular Internet site, which can be flaky for any provider.
    HTML-based applications are slow, cumbersome to load and use, and deliver a more narrow feature set than standalone applications. The only way to bridge the gap is to use something along the lines of ActiveX, but of course that's not cross-platform.
  • For an example of (1) checkout the latest versions of licq... the author has yanked the gui out of the code and has it loaded as a module...

    (2) doesn't really help matters... why not just use one toolkit if both have to be installed?

    (3) #ifdefs would be incredibly messy in this case, considering QT's main language is C++, and gtk prefers C. True they both have wrappers for other languages, but afaik, they're really no substitute.

    Doug
  • by Stinking Pig ( 45860 ) on Monday October 04, 1999 @05:47PM (#1639599) Homepage
    Okay, you asked :-)

    I want apps from both camps to support drag-n-drop, copy and paste operations from/to each other, with the same key bindings. I also want docks, start buttons, iconbars, and clickable desktop icons to go away or be easily turned off (not hidden). Like the kfm -w command.

    I'd also like the eye-candy stuff on themes.org to have links to cloned themes, so you could download two themes and have both Gnome and KDE apps use pretty much the same look, but that's not important :-)

    I use K and G apps under XFce and WindowMaker.
  • This is a completely uninformed question, but do both toolkits have the same use strategy? I obviously don't mean arguments in the same order, but more along the lines of one having an event model and the other using subclassing, or something like that.

    in summarium: is it even feasable (sp?) to write a common abstraction layer?
  • I like the idea of being able to write applications once that run anywhere, but the reality is that they won't work. Java is a nice idea, but there are so many bugs that it can't be used in any realistic sense.

    Writing for the web sould work if everyone supported the standards and only the standards. But with companies like M$ perverting everything they touch (how'd the screw up ASCII? why?) we all have to put up with code that works on one box but crashed on another.

    I usually run with Java* turned off. There's a lot of room for bad code in the standard, so it's best to just avoid it.

    In order for a place like Slashdot to exist, there have to be people around writing code for their pages to run on and code for us to talk about. I realize that you could be joking here but let's get serious. There is no way that you can write applications for the 'web' and expect them to work for everyone. Even if they did, they'd be about 1/50th the speed of a compiled app, so what's the point?

    Have a fun day, gotta go code...
  • by Ledge Kindred ( 82988 ) on Monday October 04, 1999 @11:56AM (#1639621)
    Let me preface this by saying I'm neither a GNOME nor a KDE hacker, however, I've used both GTK and Qt to bang together some silly little programs for myself.

    The question doesn't seem to be adequate to an accurate answer. If you mean "If I use Qt, can I run my apps with GNOME and if I use GTK, can I run my apps with KDE?" the answer is, "Of course."

    If you mean, "If I use gnomelib routines, will my applications run under KDE and if I use kdelib routines will my applications run under GNOME?" the answer is, "Of course."

    If you mean, "How do I write an application that will work equally well with KDE and GNOME, including things like docking and interapplication communications and all the fancy stuff that make GNOME and KDE more than just fancy window managers?" I'm pretty sure the answer is "You can't yet."

    GNOME is already pretty much "CORBA-ized" and KDE is at least partially from what I understand, with an effort to make it "fully CORBA-ized" by the next major release. (2.0) I know there is a lot of communication between the two camps to have a lot of their features interworkable. But then the question is, "What are the features of each desktop manager that you want to work with each other? Drag-n-drop? Docking? Do you want to be able to embed GNOME 'objects' in your KDE application? WHAT DO YOU WANT, MAN?!"

    You're really probably better off joining the GNOME and KDE development mailing lists and asking the question there. You will probably get a flood of useful answers since it's been my experience from lurking in the lists that the developers of the two toolsets seem to be much less prone to the "[not my brand of desktop manager toolset] sux rox!" mentality and more of the "Well, obviously we like [x] because we're programming it, but if you want [x] to Play Nicely with [y] apps, here is what works and what doesn't work yet..."

    -=-=-=-=-

  • I find it funny that you want to use Enlightenment with KDE. In my experience, Elightenment is the thing that always made GNOME seem so unstable. I switched to WindowMaker (with GNOME) and it has been way more stable than either KDE or GNOME w/ elightenment. X hasn't crashed once since I made the switch.

  • Log in and say that. Go ahead, I dare you.

    The whole idea behind linux for many people is that they don't have to use MS products anymore. Why should they be forced to choose GNOME over KDE?

    And if you are curious, I prefer GNOME.
    ---

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...