Results 1 to 5 of 5

Thread: First attempt at a gui.

  1. #1
    Join Date
    Apr 2006
    Location
    Sweden
    Beans
    Hidden!

    Question First attempt at a gui.

    I've made a few perl cli programs and now I'd like to have a go at some gui programming. I've stumbled upon glade wich I must say is a really nice app. After a hole day googling around for guides/tutorial/examples (havent found that much though. ) Ive found how to do it (in theory) The problem is that there seems to be three ways to generate perl code with glade:

    1: choose perl when saving but I dont have that option for some reason. (maybe they have taken that away as 3 seems to be the preferred way.)

    2: Use perl2gtk to generate perl code from the xml file. When trying to use this I get errors attached the log file.

    3 Dont generate perl gui code but instead call the xml file from the perl script.

    I'd like to get 1 or 2 working as I want to learn how perl gtk gui stuff works "behind the scenes" I cant read that xml file.

    Hopefully I have been clear explaining what Im trying to achieve, but feel free suggesting other ways or ide's. Maybe gtk isn't the best? It seems kinda nice though.

    I'll be very happy/grateful with ANY input here, saw a similar thread (pretty old though) with zero replies
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2005
    Location
    Vancouver, Canada
    Beans
    287

    Re: First attempt at a gui.

    The prefered way to make use of Glade is to use libglade, ie. load the widgets directly from the XML file. Take a look at this page from the gtk2-perl documentation: Gtk2::GladeXML

    After the widgets are loaded from the Glade file, you can still modify, delete and add new widgets.

  3. #3
    Join Date
    Apr 2006
    Location
    Sweden
    Beans
    Hidden!

    Re: First attempt at a gui.

    Quote Originally Posted by psychicdragon
    The prefered way to make use of Glade is to use libglade, ie. load the widgets directly from the XML file.[/URL]
    No? well I guess I'll do it the hard way then Found a great tutorial for it.
    That way I'll really learn it . And I wont be like the ppl in my class that insisted on using wysiwug html editors and the when we were supposed to add php they were like wtf? we have to MANUALLY change the code?

    btw did you read my post or did you come to the glade part and then just posted about Glade::XML ?Im gonna check it out later but wanna learn the basics first. Therefore I wanted some example perl code of what my gui would look like.

  4. #4
    Join Date
    Mar 2005
    Location
    Vancouver, Canada
    Beans
    287

    Re: First attempt at a gui.

    I read your entire post.

    I think it is a good idea to try creating the UI from scratch if you've never used Gtk+ before. Checking the class listing repeatedly is probably the best way to learn about all the widgets and their methods.

    Once you think you've got the hang of it though, there's really no point in not using Glade IMO. It saves you time, and your keeps your code from getting cluttered.

    Good luck.

  5. #5
    Join Date
    Apr 2006
    Location
    Sweden
    Beans
    Hidden!

    Re: First attempt at a gui.

    OK thanks alot for the comments psychicdragon.

    I've been sitting all day and got some basic stuff working. I am creating one of my favorite learn-yourself-app, the guess what number I'm thinking on program (80% done) Its surprisingly simple when you really get into it, why have I waited so long with gui apps? Going to move onto glade and the XML method later.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •