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

 



Forgot your password?
typodupeerror
×
GUI Graphics Software

Glade 2 Tutorial 147

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."
This discussion has been archived. No new comments can be posted.

Glade 2 Tutorial

Comments Filter:
  • by Anonymous Coward
    The original Blade was much better than Blade II, IMHO. The second one's plot was barely there, and what was there wasn't very good. However, Wesley Snipes is excellent in the role regardless, and is still worth catching on TV or video.
  • also.. (Score:5, Interesting)

    by Mr2cents ( 323101 ) on Sunday May 18, 2003 @05:56PM (#5988154)
    If I'm not wrong, glade files can also be importd in qt designer (qt's gui builder). Nice work.
    • Re:also.. (Score:3, Interesting)

      by JohnFluxx ( 413620 )
      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 :)
      • Re:also.. (Score:3, Interesting)

        by JanneM ( 7445 )
        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 ha
        • Well I suppose if you are going that far, you might as well do the seperation properly.
          Put all the ui-independant stuff in libraries, then get the build process to build both frontends. Then you can package it up as "program-backend" "program-kde" "program-gtk", for those who use packages.

          The only trouble I can see is that it would mean that your "backend" wouldn't be able to use qt/gtk libraries, which would be a major blow. I don't really know what the solution is to that problem, and I don't know how
      • This is a small portion of the qt designer manual..


        Importing Glade Files
        Glade is a free GUI builder for GTK+ and GNOME written by Damon Chaplin. The .glade extension is associated with Glade files.

        Qt Designer has been tested with Glade files up to version 0.6.0 and might work with later versions as well.

        Although Glade does not target Qt, the layout system and the widget set of GTK+ are similar to those of Qt, so the filter will retain most of the information in the .glade file.


        This is not an automag
    • You're wrong. I just tried to use QT Designer 3.1 to open a .glade file and nothing happened.
  • by zymano ( 581466 ) on Sunday May 18, 2003 @06:00PM (#5988175)
    Getting rid of xul(xml user interface language) would be good for responsive gui.
  • Thank you (Score:4, Insightful)

    by John Jorsett ( 171560 ) on Sunday May 18, 2003 @06:07PM (#5988212)
    Finally, an article that defines what the thing is instead of assuming that we've all heard of 'Zxzzy Underlayer II.3M'.
  • good thing they didnt try to make it an IDE. it is better if you keep the design modular. otherwise things get messy. Specially in GUI building tool., messy architecture can lead to memory leaks and other issues.
    • Re:not an IDE (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 [eclipse.org] running on Mono [go-mono.com] using the open source IKVM [ikvm.net] Java virtual machine for .NET by Jeroen Frijters..."

      love, peace, hope, dock

      miguel
    • Re:not an IDE (Score:5, Interesting)

      by Saint Stephen ( 19450 ) on Sunday May 18, 2003 @06:51PM (#5988422) Homepage Journal
      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.
    • Anjuta (Score:4, Interesting)

      by noda132 ( 531521 ) on Sunday May 18, 2003 @09:51PM (#5989185) Homepage

      It's a very good thing they didn't try to make an IDE, because one already exists: Anjuta [sourceforge.net]. 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 :).

      • 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.

        I've been enjoying Anjuta as well, with one minor bitch, for which I haven't solved the problem. It saves C++ files with a .cc extension. Since I use wxWindows, and I want my stuff to compile in MSVC++, I need to have a .cpp extension instead, but there appears to be no way to change the defa

        • I've been enjoying Anjuta as well, with one minor bitch, for which I haven't solved the problem. It saves C++ files with a .cc extension. Since I use wxWindows, and I want my stuff to compile in MSVC++, I need to have a .cpp extension instead, but there appears to be no way to change the default. I would *really* love it if someone would tell me. :)

          I'm not entirely sure what you mean by that as you can save a file with any extension including .cpp. If you mean the class creator plug-in then once you've e

        • You can use .cc files with MSVC just fine.. at least in MSVC7 you can by default.
      • Yeah right. I've never got Anjuta to work.

        Here's a recipe for frustration:

        1. Install Mandrake Linux

        2. Install Anjuta

        3. Try and create a project with Anjuta, and build it

        4. Write to developers, ask why a simple project with nothing added to it doesn't goddamn work

        5. Get lame ass "I dunno" from development team

        Dear God, if the simplest "build default project" screws the pooch, how do they expect anything else to work? I wonder if the Anjuta that this project is named after is like that - pretty but
  • Where's the pdf? (Score:3, Interesting)

    by G3ckoG33k ( 647276 ) on Sunday May 18, 2003 @06:12PM (#5988238)
    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.
    • Sure there is. Just about any HTML viewer can print, and if you choose "print to file" and select a Postscript printer, voilà!, instant PS file.

      Then you can easily convert that PS file using ps2pdf.
      • is there a non Adobe PDF plugin available? I have a browser on my phone that can view PDF (all smaller than 30kb) So why do I have to load 15-16 meg monster of a plugin to view them on my computer?
        • 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.
        • 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 = PS2P
    • Re:Where's the pdf? (Score:3, Informative)

      by jonman_d ( 465049 )
      I'm going to go ahead and assume you're using some sort of UNIX/Linux, and recommend: html2pdf [freshmeat.net]. 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.
      • I'm pretty sure that it would produce an ugly pdf of this series. This is a bunch of pages connected with next/previous links, with lots of internal graphics and formatting. Moving it to a word processor what a fair amount of work, but after some hand positioning of graphics it worked pretty well. And the table of contents uses page numbers.

        That said, I'm not familiar with html2pdf. But I'd rather export them (pdfs) from an OpenOffice document than depend on the html to get a connected document right.
    • 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.

    • HTMLDOC [easysw.com] from Easy Software [easysw.com] will convert an HTML file to PDF. I use it weekly, and it's fantastic.
  • Shhhhh! (Score:5, Funny)

    by Znonymous Coward ( 615009 ) on Sunday May 18, 2003 @06:14PM (#5988249) Journal
    Don't make too big of a deal about Glade. With all the recent frivolous lawsuits, SC Johnson Wax will be all over 'em.
  • Great, but..... (Score:5, Interesting)

    by mickwd ( 196449 ) on Sunday May 18, 2003 @06:18PM (#5988269)
    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 [tldp.org] 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.
  • by nother_nix_hacker ( 596961 ) on Sunday May 18, 2003 @06:19PM (#5988281)
    Pah, Glade, when I was at school all we had was Visual Basic....oh...hold on...
  • by Timesprout ( 579035 ) on Sunday May 18, 2003 @06:27PM (#5988324)
    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 !!
    • Take a look at FreeBSD [freebsd.org]. It's what Linux wants to be when it grows up (-1 flamebait). A comment I got recently when I showed it to a friend was 'Hey, this isn't like Linux at all. It has documentation!' And most of the documentation seems to be well written.
  • by Idimmu Xul ( 204345 ) on Sunday May 18, 2003 @06:32PM (#5988344) Homepage Journal
    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.
    • 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,

      • > 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.

        No, DocBook/SGML is entirely appropriate because it is a standard. As a documentation volunteer, I find no joy in having to relearn a DTD because the project maintainer wants to roll his own. I appreciate that once I learn the DocBook DTD, I can help other projects without re-learni

        • I see your point, but I have quite a few issues with the DocBook DTD that make it harder to write, and ridiculously hard to produce decent stylesheets (and oh boy, does DocBook need decent stylesheets). The sheer scope of the thing is one problem, it's hard to figure out exactly which elements you should use. The other is the verbosity of the element names. Stuff like para instead of p, variablelistentry instead of li. HTML is far more pleasant to write.
  • by A Proud American ( 657806 ) on Sunday May 18, 2003 @06:39PM (#5988377)
    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/ [gnome.org]

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

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

  • by libertynews ( 304820 ) on Sunday May 18, 2003 @06:50PM (#5988418) Homepage
    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 [vdomainhosting.com] 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

    • The proceeding post was brought to you by Popsi. Popsi, the choice of the carbonated generation. And by THAC0 Bella. THAC0 Bella, armor clas, you care? Oh, THAC0 Bella.
    • Or it could be that so little people actually care about Glade II or even need a tutorial that no one is visiting the site. It's a sad day when you get posted to slashdot and can't even get enough clicks to /. a P75
    • by Anonymous Coward
      Slashdotting mostly seems to happen to sites that

      a) have shit bandwidth
      and/or
      b) have dynamic content.

      The page you are serving is just text. There's nothing that that's going to want to make users click around (unless they're a huge glade fan) and you don't have anything dynamic.
      And you obviously have enough bandwidth.

      So it's never going to get "slashdotted"

      It's very easy to survive a slashdotting, as long as you have bandwidth. Stop the page being dynamically generated (if it is) and you're fine.

      Sata
  • Comment removed based on user account deletion
  • One of the best features is the plethora of plug ins available here [glade.com]
  • IANAL, but it seems fortunate to me that the Glade developers inserted into the FAQ included with the source distribution an explicit waiver of rights over generated C code. Glade, which is GPLed, appears to insert into generated projects at least one file support.c which is not meant to be edited and which may be required for the project to function. Without the waiver, I wonder if a Glade produced project could be considered a derived work.

    For the sake of clarity, I suggest that if someone decides to G
  • What Glade cannot do:
    * Glade doesn't develop the 'backend' of your application


    I'm interested in the toolkit that set that expectation. I'm pretty sure it's not Emacs.

  • I recently have been learning Visual Basic for work [yeah, we're ms slaves!] I also deal with the companies web site, and have been working to learn PHP.

    I ran accross PHP-GTK which is really, really cool! It lets you write VB-style apps as PHP scripts. What I haven't been able to find are any good tutorials that relate more directly to VB users. I've been playing with Dev-PHP editor, and it's almost a drop-in replacement [not code-wise silly, but exactly matches features for the task!] It runs with wi

  • when i read the title i thought it had something to do with new air fresheners. (Glade [glade.com])
  • The best way to use glade IMO is via libglade [gnome.org]. GUI code generators are usually messy, and Glade is no exception (at the very least, it should generate separate file(s) for each main window). But with libglade, your application code is neatly separated from your presentation/control code, at the price of a small slowdown at startup.

    This is not a new approach (Motif had it with UML, for instance) but lately has been neglegted in favor of code generators. I think it is time to reconsider this choice (althoug

  • Do *not* press Build (Score:2, Informative)

    by RossyB ( 28685 )
    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!
  • I was a bit surprised to see the example application was written (of all things) in C. Besides being harder and taking longer to write, it's too hard to change (and going to be flaky since a SEGV is so much easier to hit.)

    I've done some work on a framework for PyGTK (0.6 only for the moment, but GTK+2 support is coming) that makes writing an app like this one trivial. In fact, the examples include a temperature converter app (`just like ye ole Mr. Raskin said'). The code is so tiny it can fit in a /. comme

A committee takes root and grows, it flowers, wilts and dies, scattering the seed from which other committees will bloom. -- Parkinson

Working...