How does minigtk.dll in XChat for Windows work? - windows

I used to write some pygtk apps for Windows, but the GTK for Windows library is always pain to maintain. I discovered XChat for Windows using a 472KB minigtk.dll.
Can I too use this as standard gtk alternative for pygtk and others?

minigtk is primarily a modified form of gtk with the parts of gtk needed necessarily run XChat, however the use of the minigtk source is heavily crippled as Zed doesn't want other people to use it.

Related

GNOME/Vala application to run on Windows

I want to port my C# WinForms application to be usable both with Windows and Linux. I have some experience with Java and more experience with Python but I don't really like the first and I'm concerned with the second (I mean the obfuscation, need to install Python on the target PC, etc.) so I've chosen to use Vala and GTK3 toolkit... it is created mainly for making GNOME applications but I've read that it's multiplatform and is compiled fully to C also with all the dependences needed for running the software - but is it right? I mean: would I meet any limitations while creating my application on Linux? I don't want to finish it and then to discover it can't be run on Windows because I've used some GNOME library...
There are a lot of GTK applications that currently work on Windows with no problem.
For example:
GIMP (raster graphics tool - the application for which GTK was built initially)
Inkscape (vector graphics tool)
Geany (Text editor)
Pidgin
Vala apps will work anywhere a GTK apps will. Can't name a Vala app i've seen running on windows but i'll take an interest in this and get back to you.
By the way there are two (maybe several) approaches to writing the app in Vala/GTK, for example including the entire GTK library into the app or not. Geany offers 2 different binary installers meant to allow you to choose if you already have GTK on your windows download a lighter geany-only instaler, if not download the full installer which incorporates its version of GTK.
Here's a site and a tool that will help you with configuring your vala compiler to output windows executables.
I'm not sure if you can use all the tools that Vala needs on Windows. You may have to develop on a linux box.

GUI cross-development in OCaml with natural look and feel

I would like to build a GUI for an OCaml application I'm writing. My first idea was to use GTK+. I would like my application to run on Macs, Linux, Windows with a natural look and feel. I know that, while GTK+ uses X11 on the Mac by default (which looks awful), there is gtk-osx-application which uses quartz and looks natural and which I've just installed using macports.
I have three questions:
(1) Is it actually possible to use gtk-osx-application +quartz+no_x11 with OCaml? (My GODI installation which previously (with x11-based gtk2 in place) installed lablgtk2 with no problems, now (with gtk-osx-application +quartz+no_x11 and the previous x11-based gtk2 removed) is complaining about not finding /opt/local/lib/libgtk-x11-2.0.0.dylib, which is x11 related. But, as far as I know, there's no way to choose quartz over x11 when installing lablgtk2 through GODI.)
(2) If I develop my code on my Mac using the gtk-osx-application, can I use the code as is for compilation in other platforms which use different GTKs or can this bring problems?
(3) If it does bring problems, do you know of any other environment for developing GUIs in OCaml that may potentially be good regarding both look and feel and still be readily cross-used? (I am aware of labltk but I'd prefer something with more capabilities, for example, the ability to use notebooks, a.k.a tabbed panels, and being able to use Glade for rapid GUI design.)
Thanks for any help!
Cheers,
Surikator
Assuming you can get lablgtk to work, it is probably your best bet at present.
To get it working: have you tried rebuilding lablgtk after removing X11 GTK and installing Quartz GTK? A LablGTK built against X11 GTK naturally won't work on a Quartz GTK, as it will be linked against the wrong library, but a rebuild might be successful. It could also be that LablGTK won't correctly detect that X11 integration calls don't work and therefore fail to build, but I would expect that to be not-too-difficult to fix as LablGTK does support Windows.
If you develop code for GTK on Mac, it should work on other platforms just fine. You'll want to test it, of course, but it should work. Do be careful to use the GTK facilities to make things like dialog button order work properly.
I think there was at one time a set of OCaml bindings to wxWidgets, but they do not seem to be widely used and wx is painful to work with in my experience. There has also been some work on making Qt bindings, which would be awesome, but I don't think there are any projects with good headway on that front yet.
If the UI is a small-ish piece of your project, you could look at decoupling it from the backend and writing the UI in C++ with Qt, or writing platform-native UIs, and having the UI call out to OCaml code in an embedded runtime to get the real work done. But that is likely more work and may not give you much benefit, depending on your application.
So: GTK is your best option in the current landscape.

Is there any cross-platform GUI Toolkit which does not follow the one source to rule them all concept?

After a long evaluation period of mainstream toolkits Qt, WxWidget, GTK i came to the conclusion that it does not make sense to religiously equalize the different platform. Now more then ever before.
In the days before Java portability meant, that platform dependent code was located in known places and should be small but not none. No write once, run everywhere marketing.
Is there any GUI tookit - experimental or commerical (even outdated or dead projects) - that is going this way. It would need to give me native widgets of course. I would like to have a look at them before i start my own toolkit
If you think this is a stupid idea tell me why (cause everybody else is doing it differently there may be a reason i don't see)
As someone who zealously believes that GUIs should be drawn with native widgets, I must say I've been very impressed with wxWidgets, although you mention that at the beginning.
As far as I know, wxWidgets uses native widgets whenever possible, and indeed it does also include platform-specific features that are neither possible nor relevant on other platforms. A good example of this is how you can use the native Mac OS X menu, while on other systems it won't do squat. There are other and better examples.
I must mention wxPython in particular, in case you either don't want to or just don't have the time to write a C++ program. wxPython astonished me when I tried it out first, and I even managed to make a stand-alone .exe file from it that worked on a fresh install of Windows 2000 without any updates or particular runtime environments.
If wxWidgets doesn't suit your needs, I wonder what would. :) Hurray for wxWidgets!
AFAIK, wxWidgets uses the platform's native widgets whenever possible.
Have a look at SWT, it tries to use the widgets of the underlying platform as much as possible.

Is there any framework that allows me to develop applications for Qt and GTK?

I am thinking about something that would allow to develop applications independent of the GUI library, but allow Qt and GTK being plugged in as needed.
I'd just use Qt. It includes a Gtk-like style, mimics Gtk standard dialogs and even uses Gtk file dialogs if run under Gnome, so basically it integrates itself into Gtk as good as anything (except Gtk of course), or at least it integrates itself better into Gtk than Gtk does into Qt.
You can try to use wxWidgets but you tend to get "lowest common denominator" if you go that route. Your better bet is to design your software such that you can plug in an implementation of the necessary "views" in the desired toolkit, and keep your core UI toolkit independant.
Obviously this is more work, but if there is a strong business need, then so be it.
I don't know of any framework doing something like that (I don't know how it could possibly be done without suffering from a heavy "lowest-common-denominator" syndrome), but I do "cross toolkit" development (applications that use more than one GUI toolkit) and I wrote an article about why and how to do it:
http://www.hardcoded.net/articles/cross-toolkit-software.htm
You can try Tk, which supports themes. There is a tile-qt and tile-gtk theme. There is a 2010 Google Summer of Code project to improve these themes. And, of course, when you use Tk you also get support for Windows and OSX out of the box.
Qt is a framework, it uses GTK underneath (at least on Unix).
There was a mobile toolkit that let you write everything in JS but compiled to the native code on each platform. I forget the name but it was a victim of the iPhone lockdown.

On Developing Native Windows Executables

Which technology stack do you recommend for developing native windows executable (has GUI), other than .NET stack?
Other that C++ (MFC, ...) some could be named; yet which one is mature and pragmatic enough?
Delphi 7?
Common Lisp (Which one is proper for developing GUI?)?
Scheme?
Qt or wxXXX stack?
For native Win32 GUI apps, I've found nothing that beats Delphi. (Your question asks about Delphi 7, but please note that all versions of Delphi (including the latest - Delphi 2010) can produce single, standalone .EXEs).
Python is a good choice for some sorts of problems, and you can package python programs into a single .exe using py2exe.
Here is a nice py2exe tutorial: http://www.py2exe.org/index.cgi/Tutorial
Tcl/Tk is very mature, has a small footprint, is easy to learn and use, and uses native widgets on Windows and the Mac. Plus, it has a deployment mechanism second to none by way of starpacks, starkits and tclkits. You can either create a single-file executable (starpack) that embeds a very full featured virtual filesystem, or a two-file solution of a platform-specific runtime engine (tclkit) with a platform-independent application file (starkit).
It's downside is that it's low on "flash" -- there's not a lot of support for transparency, multimedia, animation and fancy graphics. So, depending on whether or not you need a lot of eye candy it may or may not be the right choice for you.

Resources