Horizontally Vertical



  • I’m working on a Linux application which uses GTK for its user interface. Instead of hard-coding each and every GUI element, it uses a library called libglade which reads a GUI definition file and dynamically creates the GUI elements at runtime. The definition file can be edited by a WYSIWYG editor called Glade.

    The application is still using GTK2 instead of the latest-and-greatest GTK3. GTK2 is still supported by most Linux distributions, so no problems here. On the other hand, the Glade editor provided by my Linux distribution does not allow editing GTK2 libglade definition files. And when I say “does not allow”, I mean “nothing happens when I select a GTK2 glade file for opening”. Not a warning, nothing. It just acts like I clicked Cancel in the file open dialog. First WTF.

    Fortunately, I found a version of Glade which is able to edit GTK2 definition files, and can be installed on my system without much trouble. Unfortunately, it is recent enough to apparently have some “transitional” features between GTK2 and GTK3.

    Instead of allowing the user to put GUI controls anywhere in a window, GTK uses layout management objects. GTK2 provides a container named GtkHBox (Horizontal Box), which lays out its child items horizontally, and a corresponding GtkVBox (Vertical Box). On GTK3, GtkHBox and GtkVBox are deprecated in favor of using GtkBox with a specified orientation.

    As it turns out, in my “transitional” Glade editor, the GtkVBox/GtkHBox containers have an “orientation” property, so you can have for instance a vertical horizontal box. Here is what it looks like when you create these items in the editor:

    Not only it’s silly, it may also get confusing since the editor trusts the “orientation” property in its WYSIWYG view whereas libglade applications will use the real container type when loading the definition file. So basically, a GtkHBox with a vertical orientation will lay out its items vertically in the Glade editor but horizontally when used in the actual app.

    I’m not done yet. Notice that the “Orientation” property of the GtkVBox is in bold. It means that it is not the default setting. Yes, in the context of the editor, the default orientation of a vertical box is horizontal. So guess what happens when I load an old GTK2 definition file which of course does not have orientation properties on the Gtk*Boxes ? It will be fixed automatically, right ? Wrong!

    As you may guess, the layout shown in the editor was quite interesting (menubar on the left, followed by the toolbar, etc...)

    After briefly looking for better solutions, I opened the definition file in a text editor (it’s an XML file) and inserted <property name="orientation">vertical</property> in each vertical container. Problem solved!



  • I admire your determination to beat this pile of confusion.

    Personally, I'd have given up long before that point and found a totally different tool.



  • @VinDuv said:

    And when I say “does not allow”, I mean “nothing happens when I select a GTK2 glade file for opening”. Not a warning, nothing. It just acts like I clicked Cancel in the file open dialog. First WTF.

    Let me guess: it prints an error message on the console.


  • ♿ (Parody)

    I'd never realized that GTK used VBox and HBox and had a configurable orientation. I've only ever touched those through wxWidgets, with abstracts those to sizers, where you simply specify an orientation. WTF GTK?!



  • Well, I migrated a personal project from GTK2 to GTK3 and not only Glade is confusing, but many other things. But, what I believe your problem is that the version of Glade you're using wasn't ready for GTK3 since it still worked with GTK2. Anyway, IMO, Glade is that kind of software which allows you to get the job done if you treat it with lots of care.


  • ♿ (Parody)

    @ubersoldat said:

    But, what I believe your problem is that the version of Glade you're using wasn't ready for GTK3 since it still worked with GTK2.

    His application was GTK2. Why would GTK3 support in Glade have helped him?



  • The title of this topic just invokes Outer Limits opening.


  • BINNED

    So how do we make sure blakeyrat never tries GTK?



  • @PedanticCurmudgeon said:

    So how do we make sure blakeyrat never tries GTK?
    I am not too worried about him using it.  I am more worried about the post he will make if he ever did try to use it.


  • BINNED

    Note to self: acquire "That's the Joke" image macro.



  • @PedanticCurmudgeon said:

    So how do we make sure blakeyrat never tries GTK?

    I've done it. I tried running Pidgin. It was shit. Is this a surprise? I think I posted about it too, but I'm not sure.

    My major gripe wasn't what you expect, but that GTK on Windows doesn't support any accessibility features-- no text-to-speech, no voice recognition, no touchscreen operations, no magnification. You know, the stuff you get for free if you use the standard Windows controls. The secondary gripe was that it used this weird mutant Open dialog which somehow didn't seem to realize that NTFS is case-insensitive.


  • Considered Harmful

    @blakeyrat said:

    GTK on Windows doesn't support any accessibility features

    I wonder what that tab with the guy in the wheelchair in OP's screenshot is all about...


  • ♿ (Parody)

    @joe.edwards said:

    @blakeyrat said:
    GTK on Windows doesn't support any accessibility features

    I wonder what that tab with the guy in the wheelchair in OP's screenshot is all about...

    I believe the issue is that since GTK doesn't use native controls on Windows, they don't (can't) play nicely with built in Windows accessibility stuff. I would guess that whatever it uses in non-Windows environments hasn't been ported to Windows or at least wasn't included in whatever installation blakeyrat was using.



  • @joe.edwards said:

    @blakeyrat said:
    GTK on Windows doesn't support any accessibility features

    I wonder what that tab with the guy in the wheelchair in OP's screenshot is all about...

    The screenshot showing a Linux application running in Linux specifically to design a Linux application? I would say it says jack shit about what happens in Windows. Would I be wrong?

    Anyway it was years back, when I was trying out Pidgin and Inkscape, for all I know it's all fixed now. I doubt it. But it's not entirely beyond the realm of possibility.



  • > Complaining about open source software



  • @blakeyrat said:

    Anyway it was years back, when I was trying out Pidgin and Inkscape, for all I know it's all fixed now. I doubt it. But it's not entirely beyond the realm of possibility.

    Inkscape at least uses the native Windows file dialogs now, but AFICT that's just something that Inkscape does vs something in the new version of GTK for Windows.


  • BINNED

    @blakeyrat said:

    The secondary gripe was that it used this weird mutant Open dialog which somehow didn't seem to realize that NTFS is case-insensitive.
    The really sad thing there is that even on Linux, which doesn't have a "native" open/save file dialog, the GTK dialogs are horribly bad. They absolutely suck, so much that I almost threw rage fits about them several times. For Pete's sake, just copy the Windows design or use QT already.

    @blakeyrat said:

    Anyway it was years back, when I was trying out Pidgin and Inkscape

    Well, at least Inkscape is a damn fine tool. For OSS, I really like its usability and shallow learning curve.

     



  • @topspin said:

    Well, at least Inkscape is a damn fine tool. For OSS, I really like its usability and shallow learning curve.

    It's arbitrary limits pissed me off. It's a vector-based tool using floating-point numbers everywhere. Why the fuck can't I make a canvas 30' by 12' if I want to? Why the fuck is it only limited to printable paper sizes? Sure I can make a paper size and then just mentally translate "ok for this document 1 inch actually means 1 foot" but why the fuck should I have to?

    Other than that one extraordinarily idiotic design decision, I thought it was actually a not-too-terrible tool. On-par with Microsoft's competing vector tool, which was at the time Expression Design (which I guess is still around? MS just doesn't ever talk about it?), but I never compared it to Illustrator.


  • BINNED

    @blakeyrat said:

    Other than that one extraordinarily idiotic design decision, I thought it was actually a not-too-terrible tool. On-par with Microsoft's competing vector tool, which was at the time Expression Design (which I guess is still around? MS just doesn't ever talk about it?), but I never compared it to Illustrator.
     

    I've never used Illustrator, but I would wager it has a bazillion more professional features, so really isn't comparable. My use was only light-weight private stuff, for which it was quite decent.

    But compare that to the Photoshop vs. GIMP discussion: Everybody says GIMP is all you need, has all the features you need and more, and is free. But then the professionals complain it has no CMYK support, so it's useless, and private users like me are just completely lost about the clusterfuck of an user interface. Do you know how long it took me to find out how to draw a circle? Yeah, drawing a circle path and then applying a stroke may be powerful, but it's nowhere near intuitive for something I can do in 5 seconds in MS Paint. (From memory, maybe it works another way. I've switched to Paint.NET for my very humble needs)



  • @topspin said:

    I've never used Illustrator, but I would wager it has a bazillion more professional features, so really isn't comparable. My use was only light-weight private stuff, for which it was quite decent.

    But compare that to the Photoshop vs. GIMP discussion: Everybody says GIMP is all you need, has all the features you need and more, and is free. But then the professionals complain it has no CMYK support, so it's useless, and private users like me are just completely lost about the clusterfuck of an user interface. Do you know how long it took me to find out how to draw a circle? Yeah, drawing a circle path and then applying a stroke may be powerful, but it's nowhere near intuitive for something I can do in 5 seconds in MS Paint. (From memory, maybe it works another way. I've switched to Paint.NET for my very humble needs)

    My main gripe about GIMP is how it treats every format except XCF as "special", so if you're working on a half-Photoshop, half-GIMP team, instaed of just operating on the PSD like any other document, you have to "import" the PSD, and then "export" it again. It treats it as an untitled document the whole time and you can't Ctrl+S.



  • @PedanticCurmudgeon said:

    So how do we make sure blakeyrat never tries GTK?

    More to the point, how do we make sure it's the only tool his employer will allow him to use?



  • @boomzilla said:

    I would guess that whatever it uses in non-Windows environments hasn't been ported to Windows or at least wasn't included in whatever installation blakeyrat was using.
    GTK+ uses ATK (Accessibility Toolkit) for accessibility support, but this's never been ported to Windows (ATK on windows is just a bunch of stubs - enough to get GTK+ to compile, not enough to do anything).
    @topspin said:
    I've never used Illustrator, but I would wager it has a bazillion more professional features, so really isn't comparable.
    It would be easier to compare it to CorelDraw, since that's what Inkscape's imitating.
    @topspin said:
    Everybody says GIMP is all you need
    Everybody that's not a GIMP developer that is.
    @MiffTheFox said:
    My main gripe about GIMP is how it treats every format except XCF as "special", so if you're working on a half-Photoshop, half-GIMP team, instaed of just operating on the PSD like any other document, you have to "import" the PSD, and then "export" it again. It treats it as an untitled document the whole time and you can't Ctrl+S.
    This was a change done in 2.8 specifically because when you save a file, you expect everything to be preserved - something that can only be guaranteed with it's native format (just a few days ago somebody was complaining on the GIMP users mailing list because he was saving [with GIMP 2.6 which didn't yet have the distinction] to PSD format exclusively, and then the file got corrupted at some point, and GIMP wouldn't open it anymore).


  • BINNED

    @flabdablet said:

    @PedanticCurmudgeon said:
    So how do we make sure blakeyrat never tries GTK?

    More to the point, how do we make sure it's the only tool his employer will allow him to use?

    +1, but don't forget about forcing him to use apt and git, plus either vim or emacs.



  • @blakeyrat said:

    Why the fuck can't I make a canvas 30' by 12' if I want to? Why the fuck is it only limited to printable paper sizes?
    FWIW, you can do this in the latest version.


Log in to reply