code logs -> 2011 -> Fri, 09 Sep 2011< code.20110908.log - code.20110910.log >
--- Log opened Fri Sep 09 00:00:06 2011
00:00
<@McMartin>
What Derakon describes is basically what Qt, Swing, and GTK+ all do under the hood.
00:00
<@McMartin>
In fact, if you target X11 at all, that's all you have to work with in the first place, so you have no chocie~
00:00
<@McMartin>
*choice
00:01
< ToxicFrog>
Yes.
00:01
<@Namegduf>
How's Qt for portability?
00:01
<@Namegduf>
Aside the "mandates C++" thing.
00:01
<@Namegduf>
Any reason you know it is unsuitable?
00:01
< ToxicFrog>
What I'm saying is that as frustrating as it is, I still prefer being the guy who uses the toolkit library to being the guy who writes the toolkit library, but a long shot.
00:02
< ToxicFrog>
Namegduf: pretty good. Only reason I'm not using it here is that iup is way easier to deploy on windows.
00:02
<@Namegduf>
Okay.
00:03
< ToxicFrog>
Works on linux, works on windows, works on OSX, works on a shockingly wide array of mobile devices, has a consistent API across all of them
00:04
<@McMartin>
Namegduf: Qt is also actually an extension of C++ that adds some Obj-C-like features to it; building Qt-based apps is thus a bit more complex as they require preprocessing into C++ first.
00:09
< ToxicFrog>
Solution: write your Qt apps in something other than C++~
00:14
<@Namegduf>
Write them in Qt-extended C
00:14
<@Namegduf>
*C++
00:15
<@Namegduf>
Have all the features
00:15
<@Namegduf>
Use all the features
00:15
<@Namegduf>
All of them
00:15
<@Namegduf>
Simultaneously
00:45
< ToxicFrog>
hate hate hate hate hate hate hate hate hate hate hate hate hate hate
01:03 Derakon[AFK] is now known as Derakon
01:58 Attilla [Some.Dude@Nightstar-f29f718d.cable.virginmedia.com] has quit [Ping timeout: 121 seconds]
02:19
< gnolam>
So, in other words, "don't use Qt"? :P
02:25 shade_of_cpux is now known as cpux
02:25 Kindamoody[zZz] is now known as Kindamoody
02:40
<@McMartin>
gnolam: I'd claim Qt4 is the best-of-breed, overall, actually.
02:44
< gnolam>
The description you give is one of "stay the hell away".
02:44
< ToxicFrog>
gnolam: no, the hate was for the way IupTree seems to have different semantics on linux and windows.
02:44
< ToxicFrog>
gnolam: only if you're using C++ directly, which you really shouldn't, because, well, it's C++.
02:45
< gnolam>
Apollo 13? :P
02:46
<@McMartin>
gnolam: Qt's signals/slots mechanism is so much better than Gtk's bullshit that it's very much worth writing the four extra lines in your makefile.
02:50
< ToxicFrog>
How, exactly, do signals/slots work?
02:54 gnolam [lenin@9D46A2.F4E9D7.E4B4CF.2072AD] has quit [[NS] Quit: Z?]
03:25
<@McMartin>
ToxicFrog: Almost exactly like ObjC or Smalltalk message-passing.
03:25
<@McMartin>
Some methods may be declared as "slots", and the API does this for most GUI events.
03:25
<@McMartin>
There are also classes called "signals".
03:26
<@McMartin>
You can connect signals to slot methods; they have to have compatible signatures.
03:26
<@McMartin>
Upon doing this, sending that signal to that object will call that method.
03:26
<@McMartin>
So, for instance, actionPerformed() is a signal sent by clicking a button, selecting a menu item, etc.
03:27
<@McMartin>
By wiring actionPerformed() to the same model object's slot, you can map various gestures to the same code, much as one can do in ObjC or, indeed, any sane GUI development system.
03:27
<@McMartin>
(I forget how Glade does this, but I think it's via utility methods with roughly these semantics.)
03:27
<@McMartin>
Duck-typed method calls turn out to map really well to GUI paradigms, the only real competitor being publish-subscribe (which is what Swing uses).
03:31
<@McMartin>
IIRC, the Qt preprocessor turns signal/slot calls into library calls to an extended runtime that basically adds limited reflection to C++.
03:32
< ToxicFrog>
Ok, my question then is how this differs in any way from what GTK+ does.
03:33
<@McMartin>
The last time I used GTK+ directly you had to hand-manage all your callbacks.
03:33
<@McMartin>
And I'm not sure, but I don't think GTK lets you define your own?
03:33
< ToxicFrog>
What do you mean by "hand-manage" here?
03:34
<@McMartin>
Again, GTK has improved a lot since I last used it (2.1)
03:34
<@McMartin>
In particular, Glade didn't really exist except as a prototyping tool.
03:34
<@McMartin>
I suspect the Glade runtime should now be capable of doing this.
03:34
<@McMartin>
But the Glade runtime is C based, and C based object systems can be ObjC-like if they want to.
03:34
< ToxicFrog>
I mean, in GTK, it's "hook functions up to the signals you're interested in", where signals are things like "clicked" or "contents edited"
03:34
<@McMartin>
Ah.
03:35
<@McMartin>
In Qt you can define your own signals and use the same machinery for arbitrary stuff.
03:35
< ToxicFrog>
I think you can do that in GTK as well, but I've never had to, so don't quote me on that.
03:35
<@McMartin>
My continuing beef with Gtk has been that it isn't single-source, multiplatform, and that's the only reason you'd use it.
03:36
< ToxicFrog>
"single-source multiplatform"?
03:36
<@McMartin>
Every major GTK-based app I know of basically has to rewrite its view for each target OS, Mac support is Right Out without X11 emulation (which sucks), and once you're in that position you might as well be writing your views with the native APIs.
03:36
<@McMartin>
(Those apps are Azureus, Eclipse, and Pidgin~)
03:37
< ToxicFrog>
(I thought Azureus was Java-based?)
03:37
< ToxicFrog>
(...as was Eclipse, for that matter?)
03:37
<@McMartin>
(So is Eclipse. However, they use IBM's widget set, which is a call-for-call wrapper around GTK.)
03:37
< ToxicFrog>
(Aah.)
03:38
<@McMartin>
(I don't remember the name of the wrapper offhand.)
03:38
< ToxicFrog>
(I can't speak for OSX, but I have GTK+-based programs that run unmodified on both windows and linux, modulo a config file telling it where the libraries are)
03:38
< ToxicFrog>
(that said, they're all written in Python or Lua)
03:39
<@McMartin>
(Yes. GTK doesn't work for shit on modern OS X, because if it ever bound to anything, it was half-assedly bound to Carbon.)
03:39
< ToxicFrog>
(which both have bindings that abstract away a lot of the GTK+ machinery)
03:39
<@McMartin>
(Qt has direct Cocoa bindings on OS X and both runs and looks like a Mac-native app with the same source as a Linux app.)
03:39
< ToxicFrog>
Are there any cross-platform GUI libraries that work for shit on OSX and aren't Qt?
03:39
<@McMartin>
Swing.
03:40
<@McMartin>
Those are the only two I know of, and accepting this means you have to buy that Swing works for shit anywhere.
03:40
<@McMartin>
TkInter might kinda work, I haven't tried it.
03:40
<@McMartin>
"Interfaces with X11.app" counts as "does not work on OS X"
03:40
<@McMartin>
OS X support natively is kind of rare because OS X's native entry point isn't C-based.
03:41
< ToxicFrog>
Based on prior experience with Swing this is not something I'm willing to concede~
03:41
<@McMartin>
While Windows doesn't have the POSIX entry point for its native executables, but it still uses the C linking mechanism, so you just need to tweak some #defines and make options and everything links with no trouble.
03:41
<@McMartin>
OS X compat usually requires including additional source files to glue your actually application into the ObjC frame code.
03:41
<@McMartin>
(See also SDL.)
03:42
< celticminstrel>
I thought there was a GTK Cocoa in the works.
03:42
<@McMartin>
"In the works" is different from "has been active in the wild for 2+ years".
03:42 * ToxicFrog eyes wxLua, which seems to be fairly popular despite using wx.
03:42
< celticminstrel>
Fair enough.
03:43
< ToxicFrog>
...man, never before has a toolkit usage example convinced me so quickly that I don't want to use it.
03:43
<@McMartin>
TF: wx, IIRC, has issues on 64-bit MacOS X, but does properly interface with Carbon-based systems.
03:43
< celticminstrel>
[Sep 08@10:40:33pm] McMartin: "Interfaces with X11.app" counts as "does not work on OS X"
03:43
<@McMartin>
Also, you have no idea.
03:43
< celticminstrel>
This I agree with.
03:43 * celticminstrel stabs GIMP.
03:43
< ToxicFrog>
It would if OSX's X11 implementation weren't so impressively bad~
03:43
< ToxicFrog>
But yes.
03:44
< ToxicFrog>
wxLua looks like they took a large and ugly C API and gave it the most minimal wrapper possible, which has the advantage that you can use all of the C documentation for it but the disadvantage that you'd have to be damaged in the head to want to use it.
03:44
< ToxicFrog>
AAAGH I HATE USER INTERFACES
03:45
<@McMartin>
It's worse than that.
03:45
<@McMartin>
wx is actually C++ based, which means that its objects aren't portable across DLL boundaries unless you use exactly the same compiler with exactly the same options.
03:46
<@McMartin>
Also, it hardcodes string width, which is fucking awesome because it took them almost a decade to let you install non-statically-linked applications with different ideas about what that length should *be* on the same system.
03:46
<@McMartin>
This was in fact the penultimate straw that led to me abandoning gentoo~
03:46
< ToxicFrog>
In the case of wxLua specifically, this is solved by statically linking wx into a custom wxlua executable that one uses instead of the stock lua(1).
03:47
< ToxicFrog>
Which is not an unreasonable approach in general (hell, I used it for luapilot)
03:47
<@McMartin>
That's statically linking it, which I put an exception for in right up there~
03:47
< ToxicFrog>
But leaves you with the problem of an API that not even its mother could love.
03:47
<@McMartin>
In the dynamic approach, I was unable to compile anything at all, up to and including the Hello World app copy-pasted from their own fucking documentation.
03:48
<@McMartin>
My joke for some time was that wx was less a GUI library and more a test suite for compiler error messages.
03:48
< ToxicFrog>
Based on my own experiences this is very much "ha ha only serious".
03:49
<@McMartin>
We use Qt at my job; before that, it was wx.
03:49
<@McMartin>
So I've had to deal with both professionally.
03:49
<@McMartin>
In not entirely unrelated news, I've become a fan of Qt~
03:49
<@McMartin>
(Oh yeah, the other nice thing about Qt is that they do paid support, and as a company they were pretty damn good about it while we needed it)
03:51 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
03:52
< ToxicFrog>
I am seriously weighing the virtues of eating the deployment difficulties and rewriting the UI to use Qt vs. telling windows users "too bad, you get your game list in random order" vs. figuring out what I need to sacrifice to Azathoth to get the game list to work on windows vs. punting the project entirely and revisiting it next year^W^Win five years^W^W^Win a few decades^W^W^W^Wnever when GUI implementation sucks less.
03:52
<@McMartin>
Do the second one first, because half a loaf etc.
03:55
< Reiver>
What the heck are you working on TF
03:56
< ToxicFrog>
Reiver: client for backloggery.com
03:57
< Reiver>
TF: Give up on it, do Felt instead~
03:57
< ToxicFrog>
brb, stabbing Reiver
03:57
< Reiver>
aie
03:57 * Reiver screams and dies.
04:04
<@McMartin>
TF: What's the Windows deployment difficulty for Qt, incidentally?
04:05
<@McMartin>
"DLLs will probably exist"?
04:05
<@McMartin>
IME Qt is harder to get a compiler to understand than it is to get running.
04:05
<@McMartin>
But then, I've only used the C++/extended C++ stuff, with (formerly) commercial MSVC integration scripts, so.
04:06
< ToxicFrog>
On windows it's actually not too bad, I just need to package it with the windows release (the nice thing about iup is that it's built into the windows version of the runtime)
04:06 * McMartin nods
04:06
<@McMartin>
ISTR it's *possible* to statically link Qt4, but given the size of the damn library I'm not convinced it's desirable.
04:07
< ToxicFrog>
On linux it's uglier because AFAIK no-one has lqt in the repos.
04:07
<@McMartin>
Definitely a bigger problem.
04:08
<@McMartin>
Speaking of Linux, time to try to get Pulseaudio to bend to my will
04:09
< ToxicFrog>
Honestly, using scala and just using the jar-insertable GUI library du jour looks better and better.
04:09
< ToxicFrog>
At least until I remember that probably means Swing.
04:09
<@McMartin>
Heh
04:10
<@McMartin>
Yeah, so, Swing's use of publish-subscribe instead of duck-typing is one of the reasons it's so insufferable~
04:10
<@McMartin>
This is another reason I hate OO fundamentalists~
04:10
< ToxicFrog>
Honestly I remember very little about why I dislike Swing.
04:11
< ToxicFrog>
Those months, in my memory, are just a haze of rage and frustration.
04:11
< ToxicFrog>
Granted, much of that stemming from Java in general and not Swing in specific.
04:12
<@McMartin>
Swing has exactly one massive advantage if you're going tri-platform: it's the only GUI library in a language more than one company uses that Apple tuned to automatically meet its OS's usability guidelines if you use default layout settings.
04:13
<@McMartin>
Qt4 comes *close* but AIUI doesn't quite make it.
04:13
<@Namegduf>
Isn't Swing the one that resolves attempting to look good on all platforms by looking equally horrific on all of them?
04:14
<@Namegduf>
Or am I confusing it with some other terrible Java UI library?
04:15
<@McMartin>
You're confusing it with java.awt, the poster child for why "uses native widgets" is a bug and not a feature.
04:15
<@McMartin>
Swing looks fairly reasonable on all OSes as long as you aren't an idiot about it.
04:15
<@McMartin>
http://blorple.sourceforge.net/blorple.png
04:16
< ToxicFrog>
IME, Swing looks equally ugly on all platforms, but not as ugly as Tk or Motif.
04:16
< ToxicFrog>
Going by that screenshot, apparently it uses (or at least imitates) native widgets on OSX, but it really doesn't on Linux or Windows.
04:16
<@McMartin>
TF: Imitiates.
04:17
<@McMartin>
Windows it tends to imitate the wrong ones.
04:17
<@McMartin>
That is to say, it tends to imitate Windows 2000's.
04:17
<@McMartin>
I haven't tried this on Win7 with Aero; I should.
04:17
< ToxicFrog>
On Linux it has a wide variety of fully skinnable and themable appearances, none of which bear any resemblance to any other toolkit common on linux at any point in history, AFAICT.
04:18
< ToxicFrog>
Hrm. There's Java bindings for Qt, but they look kind of...not good.
04:18
<@McMartin>
Also horribly out of date.
04:19
< ToxicFrog>
I thought 4.7.x was the latest Qt?
04:20
<@McMartin>
In that case, they've updated it very recently.
04:20
<@McMartin>
In the 4.6.x timeframe the latest Javari was like 4.2
04:20
< ToxicFrog>
AFAICT it was originally developed by Nokia, then abandoned, then handed over to an open-source group who brought it up to date and are still maintaining it.
04:20
< ToxicFrog>
This is QtJambi, Javari didn't even show up on google.
04:21
< ToxicFrog>
(really in terms of packaging and whatnot it actually looks pretty good, but the documentation Does Not Impress)
04:21
<@McMartin>
Swing in Windows 7: http://i52.tinypic.com/k39dtd.png
04:21
<@McMartin>
It's not *quite* native, but it's pretty close.
04:22
<@McMartin>
(The big gap after the image is the fault of the app, more or less~
04:22
< ToxicFrog>
That is pretty good, yeah.
04:22
<@McMartin>
The key thing is, you have to tell swing "imitate platform X", and if you don't do this it looks like ass because it imitates CDE, which is even worse than Motif.
04:23 * McMartin abuses the fuck out of inner classes, treating them like lambda expressions for setting up the Swing publish-subscribe stuff
04:23
<@McMartin>
This, uh, made it a little less painful, if I didn't think about it too hard, but it is kind of a hard technique to recommend~
04:26
< celticminstrel>
Inner classes are one interesting feature that I like in Java.
04:27
<@McMartin>
This is where my functional-language biases show through - they're basically a pale imitation of lexical scoping in LISP and ML dialects.
04:28
<@McMartin>
("pale imitation" is a little unfair here; objects and lexical closures are isomorphic and you can mechanically transform either one into the other)
04:36 Rhamphoryncus [rhamph@Nightstar-14eb6405.abhsia.telus.net] has quit [Client exited]
04:53
< ToxicFrog>
Hmm. I wonder if this would make Swing noticeably less painful in Scala.
04:54
< ToxicFrog>
It has a lot of FP features that compile down to Java inner class trickery.
04:57
<@McMartin>
That's an interesting question, because it does mean "assign this on-the-fly-created ActionListener to this widget's click signal" can be written as "when you click, do this code right here")
05:09
<@McMartin>
I had hoped to try this out with Android, but Scala For Android is apparently still kind of a pipe dream.
05:26 Vornicus-Latens is now known as Vornicus
06:22 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
06:46 Derakon is now known as Derakon[AFK]
08:27 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has joined #code
08:35 Vornicus is now known as Vornicus-Latens
09:05 AnnoDomini [annodomini@60F158.737D66.CA1918.CC7562] has joined #code
09:38 You're now known as TheWatcher
10:35 AnnoDomini [annodomini@60F158.737D66.CA1918.CC7562] has quit [[NS] Quit: Will next appear at Frognerseteren.]
11:35 Attilla [Some.Dude@Nightstar-f29f718d.cable.virginmedia.com] has joined #code
12:22 cpux is now known as shade_of_cpux
13:18 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code
14:22 Kindamoody is now known as Kindamoody|out
15:07 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
15:38 shade_of_cpux_ [chatzilla@Nightstar-c5874a39.dyn.optonline.net] has joined #code
15:40 shade_of_cpux [chatzilla@Nightstar-c5874a39.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
15:41 shade_of_cpux_ is now known as shade_of_cpux
16:47 Rhamphoryncus [rhamph@Nightstar-14eb6405.abhsia.telus.net] has joined #code
17:21 Vash [Vash@Nightstar-f03c5637.sd.cox.net] has joined #code
18:12 Vash [Vash@Nightstar-f03c5637.sd.cox.net] has quit [[NS] Quit: BWAHAHAHAHHA! ]
19:22 Vornicus-Latens is now known as Vornicus
20:18 Kindamoody|out is now known as Kindamoody
21:01 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has quit [[NS] Quit: If the world didn't suck, we'd all fall off.]
21:21 Kindamoody is now known as Kindamoody[zZz]
22:06 Stalker [Z@2C3C9C.B2A300.F245DE.859909] has joined #code
22:07
< kwsn>
http://search.cpan.org/dist/Acme-EyeDrops/lib/Acme/EyeDrops.pm this can not be legal, and definitely not sane
22:13
< TheWatcher>
It's perl
22:13
< TheWatcher>
Of course it's not either!
22:15
<@Tamber>
...hahahaha
22:22
< kwsn>
:P
23:19 Stalker [Z@2C3C9C.B2A300.F245DE.859909] has quit [Ping timeout: 121 seconds]
23:19 Stalker [Z@2C3C9C.B2A300.F245DE.859909] has joined #code
23:59 shade_of_cpux is now known as cpux
--- Log closed Sat Sep 10 00:00:22 2011
code logs -> 2011 -> Fri, 09 Sep 2011< code.20110908.log - code.20110910.log >

[ Latest log file ]