Slashdot Mirror


Glade 2 Tutorial

Renartthefox writes "Rikke D. Giles has written a new tutorial for Glade II. Glade is a program designed to enable the quick building of graphical user interfaces for GTK+ and GNOME applications. However, it can be used with any desktop environment in linux, as long as the GTK+ and/or GNOME libraries are installed."

34 of 147 comments (clear)

  1. also.. by Mr2cents · · Score: 4, Interesting

    If I'm not wrong, glade files can also be importd in qt designer (qt's gui builder). Nice work.

    --
    "It's too bad that stupidity isn't painful." - Anton LaVey
    1. Re:also.. by JohnFluxx · · Score: 2, Interesting

      The xml files it spits out?
      Does that mean that you could write an app that parses the glade xml and generate not only the gtk widgets on the fly (already possible) but also qt, with the user deciding which one they want?
      Now that would be cool :)

    2. Re:also.. by JanneM · · Score: 3, Interesting

      Well, no.

      Or rather, you could, but it'd be almost just as easy to do as writing for both toolkits without it - ie. not at all. You still need to work with the widgets in your code (at least defining callbacks), and thus you'll need separate codepaths. Also, you'd need to include stuff for both toolkits, which means that the user will need to have both installed even if they use only one of them.

      What you could do is have that choice at compile-time. Write the backend completely toolkit-independent, then have two frontends, using the glade file (so they always are in sync, UI-wise) and including the backend stuff. At compile time, it is determined which of them (or both) to build.

      --
      Trust the Computer. The Computer is your friend.
  2. Mozilla and Phoenix need this by zymano · · Score: 3, Interesting

    Getting rid of xul(xml user interface language) would be good for responsive gui.

    1. Re:Mozilla and Phoenix need this by cheesybagel · · Score: 4, Informative

      XUL may be slow but it is more portable than GTK+ is.
      Yes I know there is a GTK+ port for Windows but neither it is fast itself or just having Windows support in addition to X11 support is enough.

    2. Re:Mozilla and Phoenix need this by lewp · · Score: 2, Insightful

      If I'm not mistaken, enabling GTK2 doesn't get rid of XUL. XUL is essentially responsible for "describing" the UI, which is then generated using the GUI toolkit you enable. emerge'ing with WANT_GTK2 simply says that the XUL is ultimately rendered using GTK2 (instead of GTK1), not that it isn't used anymore.

      --
      Game... blouses.
  3. Thank you by John+Jorsett · · Score: 3, Insightful

    Finally, an article that defines what the thing is instead of assuming that we've all heard of 'Zxzzy Underlayer II.3M'.

  4. Where's the pdf? by G3ckoG33k · · Score: 2, Interesting

    Where's the pdf/ps/etc? Ok, I know, pdfs are not GNU, but still. I like reading tutorials in paper form rather than html. I'm sure there is a way for "rapid" translation.

    1. Re:Where's the pdf? by jonman_d · · Score: 2, Informative

      I'm going to go ahead and assume you're using some sort of UNIX/Linux, and recommend: html2pdf. I think it may actually have a windows version, as well, but I'm too lazy to double check. It's a swell product, either way.

    2. Re:Where's the pdf? by samhalliday · · Score: 2, Informative
      Ok, I know, pdfs are not GNU

      why not? adobe have released the PS and PDF formats very openly and as a direct result GNU programs (such as ghostscript) are ready to read them with no patent issues or reverse engineering required.

    3. Re:Where's the pdf? by TheRaven64 · · Score: 2, Interesting
      you're showing your windows baby roots

      In what way is PDF a windows thing? I write documents in LaTeX (using vim as the editor), compile them to pdf under FreeBSD and people can look at them on *nix, Windows and Mac. And they contain things like tables of contents that make sense when printed (which will in theory be possible with CSS3 but, let's face it, that's not going to be ready for a long time). Oh, and the character spacing etc makes them a lot easier to read than the same content in html rendered by a browser.

      The difference is the same as that between compiled and interpreted code. Interpreted code may be more convenient, but takes a lot more CPU time in total, and won't run as fast (read look as good, in the case of text processing).

      --
      I am TheRaven on Soylent News
  5. Re:Something stinks by Anonymous Coward · · Score: 3, Funny

    Why am i not surprised that Slashdot readers haven't heard of air freshener....

  6. Shhhhh! by Znonymous+Coward · · Score: 4, Funny

    Don't make too big of a deal about Glade. With all the recent frivolous lawsuits, SC Johnson Wax will be all over 'em.

    --

    Karma: The shiznight, mostly because I am the Drizzle.

    1. Re:Shhhhh! by kurosawdust · · Score: 4, Funny
      Don't make too big of a deal about Glade. With all the recent frivolous lawsuits, SC Johnson Wax will be all over 'em.

      Or at least just the plug-ins.

  7. Great, but..... by mickwd · · Score: 5, Interesting

    Can we have articles like this listed and catalogued in a single place somewhere ?

    If I happen to be wanting to learn Glade 2 now, this article will be really useful. Otherwise, I could bookmark it for future reference (assuming it'll still be there in a few months time) - or download it, and save it on a directory somewhere.

    What about having somewhere such as the Linux Documentation Project keep a collection of articles like this (or keep a list of dated bookmarks to useful external articles) - simultaneously making both the Linux Documentation Project, and the articles in links to, more useful resources to more people.

    1. Re:Great, but..... by Sleepy · · Score: 2, Insightful

      > It's called google you dumb shit.

      It's a valid question... and, Google sucks for finding things like this. Sorry. Trust me.. Google is going to miss a lot of things, or perhaps you would filter them out by your keywords.

      "Subject" matter like this can be grouped under a directory, like Open Directori, Yahoo (if they maintained theirs anymore which they don't), LDP, etc.

      Anyways, the best place to "find these things" is the FootNotes (GNOME) website.

      I think it's funny how people keep associating GTK and Glade with Linux... like BSD, Sun, and Windows don't exist (GTK2 runs great under Windows BTW.. I'm having fun experimenting with PyGTK under both Linux and win32)

  8. You've got it lucky these days by nother_nix_hacker · · Score: 4, Insightful

    Pah, Glade, when I was at school all we had was Visual Basic....oh...hold on...

  9. Re:not an IDE by Miguel+de+Icaza · · Score: 2, Informative

    There is a c/c++ IDE option if needed, but its convoluted as hell!
    from the faq:
    "...you can import the glade toolkit bindings into Eclipse running on Mono using the open source IKVM Java virtual machine for .NET by Jeroen Frijters..."

    love, peace, hope, dock

    miguel

    --
    Before adopting WHATWG, read the moonlight.NET EULA [http://www.microsoft.com/interop/msnovellcollab/moonlight.mspx]
  10. When will it end ?? by Timesprout · · Score: 5, Funny

    What is the linux community coming to when people actually write tutorials on how to use applications. Man pages with so many options they resemble a form of Hieroglyph were just about acceptable. Worse was to follow a lot half heart how-to's which fortunately seldom explained what you actually wanted.
    Next thing you know linux apps will be come fully documented, with samples and context sensitive help. Anyone will be able to use them !!

    --
    Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
    What truth?
    There is no dupe
  11. Re:Well, OK, by be-fan · · Score: 2, Interesting

    Too bad Quartz Extreme isn't actually "an OpenGL-accelerated desktop." It only accelerates compositing (window effects), so it's not in the same league as stuff like the Longhorn UI or E17's EVAS, which can actually use OpenGL to accelerate visually complex drawing. Also, Apple's implementation isn't that great. It stores huge bitmaps everywhere, even though DisplayPDF is inherently vector based, and as mentioned above, doesn't take good advantage of the capabilities of current cards. For example, it won't accelerate line drawing, because current cards can only do AA line drawing through OpenGL, which Quartz2D doesn't use.

    --
    A deep unwavering belief is a sure sign you're missing something...
  12. GNOME needs more user friendly documentation. by Idimmu+Xul · · Score: 5, Insightful

    GNOME has some wonderful technologies at it's disposal, but the documentation is crap. Reading someone else's code is not the best way to learn imho, and some decent documentation covering bonobo etc is just what the doctor ordered.

    --
    The problem with slashdot is that most of its users were bullied and stuffed into lockers as kids!
    1. Re:GNOME needs more user friendly documentation. by IamTheRealMike · · Score: 2, Interesting
      Well, personally I've found the GTK documentation alrightish, though gtk-doc pages take a bit of getting used to. Wading through a huge synopsis is a bit annoying at first, until you get more familiar with it, and then being able to rapidly jump to the function you want using Geckos type ahead find is just plain cool.

      Unfortunately, it's still put to shame by MSDN. The docs are sometimes missing, sometimes wrong..... when I encounter these things I write a patch and submit it, it only takes a few minutes, and if more people did it the docs would improve faster.

      The docs for the GNOME libs though are a bit poor, but the same could be said of KDE, a lot of it is out of date, too sparse etc.

      Really, at some point Linux needs to leave its fascination with SGML/DocBook behind. I hate it for so many reasons. It really sucks. A custom solution I think could do what DocBook does better, faster and with less hassle.

      It'd be nice to have better searching as cross referencing as well. DevHelp is OK but rather buggy (I'm thinking of trying to fix a few of those bugs this week). As ever, I'd love to try and fix them, I like the technologies, but I have little time and other projects take higher priority. Really somebody just needs to be contracted to work on them for a bit, a developer support role perhaps. If there are any companies out there who want to use GTK for their apps but want proper developer support, get in touch!

  13. Re:SERIOUSLY OT:Where's the pdf? by agurkan · · Score: 2, Informative

    yep, there is one. plugger plugin along with an installation of ghostscript will do on Linux. although this might not save you space ghostscript is a lot easier to find than acroread since it has dual licensing and older version are GPL.

    --
    ato
  14. Additional Glade info by A+Proud+American · · Score: 5, Interesting
    Due to the nature of the work at my place of employment, we're generally stuck using Visual C++ (on the Windows platform) for most of our coding.

    Nonetheless, I work with Glade on weekends for fun. Here are some other interesting links that you'll undoubtedly enjoy:

    http://developer.gnome.org/

    http://www.daa.com.au/~james/pygtk/

    http://www.student.oulu.fi/~jlof/gtkglarea/

  15. I hate to break this to you by A+Proud+American · · Score: 3, Interesting

    But what Linux needs is a fresh look and a fresh batch of research into creating a truly intuitive desktop computing experience.

    Windows isn't intuitive, but because it's so popular, people have had to learn how to get work done and consistent interfaces across Microsoft applications helps this.

    But if Linux hackers want a new crowd of free software users, they need to attract them not only with the low price of open source software, but a high intuitivity index of the software itself.

    Someone please make Linux more easy to use. It's too hard.

    1. Re:I hate to break this to you by mr.+marbles · · Score: 2, Informative

      when it comes to designing interfaces, it's best to exercise the rule of least surprises. it's better to behave exactly like what other people would expect you to behave like than to do things in a more efficient manner but alienate all your users by pulling the rug from under them. An example of this is the QWERTY keyboards, sure there's more efficient ways of doing it but QWERTY has lasted because so many people has been trained with it that it has in effect become a standard.

    2. Re:I hate to break this to you by NanoGator · · Score: 2, Insightful

      "Windows isn't intuitive, but because it's so popular, people have had to learn how to get work done and consistent interfaces across Microsoft applications helps this."

      That's debatable. Microsoft provided a visual metaphor that people could associate with. From there, it was easy for people to grasp on to. For example, 'folder' makes more sense than 'directory'.

      Though I agree with you that Linux is too hard and it needs a 'truely intuitive' desktop, I don't think you give enough credit to MS for the work they did on the Windows UI. Millions of people wouldn't have flocked to it if they couldn't figure out how to make it work. Windows wasn't always on top.

      --
      "Derp de derp."
  16. You Killed Our Server! You Bastards! NOT! by libertynews · · Score: 4, Interesting

    Something strange is happening here. I am not seeing any kind of adverse effect to the machine from being slashdotted. Its chugging along fine, happily serving up pages.

    Hmm, must be some kind of multi GHz Quad Processor heavy iron type of box, right?

    Nope.

    P75, 48megs of ram. No kidding.

    cat /proc/cpuinfo
    model : Pentium 75+
    vendor_id : GenuineIntel
    bogomips : 40.04

    Granted, I'm only seeing 109 current connections to the web server right now. But its running just fine. This is probably mostly due to our colocation hosts at VDomainHosting having enough available bandwidth to serve things up in a timely manner. Thanks guys!

    And thanks to Rikke for such a great tutorial. She presented it a few weeks ago at the Linux Fest NW event, to a packed room.

    Brian
    KPLUG Webmaster

    --
    Remember Lexington Green!
  17. Re:not an IDE by Saint+Stephen · · Score: 4, Interesting

    I learned about glade by trying DIASCE2, a Visual IDE for Glade. Before Glade I couldn't grok automake, pkg-config, much less GTK; by writing a simple Hello Glade World I grokked it all, wrote my own build scripts, and started writing Gnome apps.

    Glade was only a stepping stone for me to using the raw GTK api. I find GTK in C to be quite elegant. The only real wart I found is that Popped-up menus are reparented in a fake GtkWindow, where as top levels aren't. Baring that, raw GTK in C is good enough for me.

    "The world is fundamentally functional and relational." -- Quote from a grayheaded Silicon Valley dude, there's wisdom.

  18. Many options by onShore_Jake · · Score: 2, Funny

    One of the best features is the plethora of plug ins available here

  19. Anjuta by noda132 · · Score: 3, Interesting

    It's a very good thing they didn't try to make an IDE, because one already exists: Anjuta. And best of all, Anjuta not only offers all the usual editor/compiler mumbo-jumbo, but it also calls Glade for GUI creation.

    If you're trying to start out GNOME/GTK development, Anjuta's the IDE of choice (as far as I can see). Of course, all I did in it was make a little "Hello, world!" app that would hide the message when you click a button. But it was very simple to make and had full i18n support -- for 5 minutes from start to finish, that's not half-bad :).

  20. Re:Well, OK, by nacs · · Score: 2, Insightful
    so it's not in the same league as stuff like the Longhorn UI or E17's EVAS, which can actually use OpenGL to accelerate visually complex drawing
    Longhorn uses DirectX 9 for it's GUI acceleration -- not openGL.

    Not trying to flamebait but it'll be a cold day in hell when Microsoft uses openGL over it's own DirectX technology.
    --
    "I filter at +6, and have yet to miss out on an important comment." (#822545)
  21. Do *not* press Build by RossyB · · Score: 2, Informative

    Pressing the Build button is about the worst thing you could ever do in Glade.

    Save the .glade file, and then use libglade to load and build the interface at runtime. .glade files are very simple to parse so building the interface at runtime is very fast, and you have far more freedom to alter the interface at any point in the future.

    Don't press Build!

  22. Re:SERIOUSLY OT:Where's the pdf? by JesseL · · Score: 2, Informative

    I put this entry into the printers section of smb.conf on my Samba server. This lets everyone on the network create PDF files from any application that can print. The created PDFs are available in the shared /PDF directory on the server and are named for the user that made them. This could probably be improved, but it works pretty well as is.

    [PS2PDF]
    comment = PS to PDF
    printable = yes
    public = yes
    guest ok =yes
    read only = yes
    create mode = 0700
    directory = /tmp
    printer name = PS2PDF Printer
    printer driver = HP Color LaserJet PS
    print command = mv %s %s.ps; /usr/bin/ps2pdf %s.ps %s.pdf; rm -f %s.ps; mv %s.pdf /PDF/%m.$$.pdf

    --
    "Prefiero morir de pie que vivir siempre arrodillado!"