Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Good tool/IDE for GTK+python

  1. #11
    Join Date
    Aug 2007
    Location
    127.0.0.1
    Beans
    1,800
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Good tool/IDE for GTK+python

    Quote Originally Posted by hellmet View Post
    @jesui... (sry, lazy)
    I'm stuck at the same place man.. All tutorials speak in detail, until the point where GUI connects to code. After that its a sample code and some comments and.. good bye!

    I would really like a detailed tutorial explaining how each component of GUI can be integrated into the python code.
    Off to the reference.

    The GUI connects to code only through: Events and references. It's as simple as that, whenever a button is pushed, text field written to, or anything, you can add a string in the "event window" (can't remember the exact name on Glade3), and append that signal to the python dictionary, and attach a method to decide what to do.

    Whenever you need help on a particular component, then head to the reference.
    "Just in terms of allocation of time resources, religion is not very efficient. There's a lot more I could be doing on a Sunday morning."
    -Bill Gates

  2. #12
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Good tool/IDE for GTK+python

    Here is part of a program I am working on. The glade file exported as a builder file is testimport.glade, I show just some of the other objects: Then I have code to handle all the buttons etc.

    Some code to check stuff
    try:
    self.builder = gtk.Builder()
    self.builder.add_from_file("testimport.glade")
    except:
    self.show_error_dlg("Failed to load UI XML file: testimport.glade")
    sys.exit(1)

    # get the widgets which will be referenced in callbacks
    self.window = self.builder.get_object("window1")
    self.notebook1 = self.builder.get_object("notebook1")
    self.statusbar = self.builder.get_object("statusbar")
    self.btnimport = self.builder.get_object("btnImport")
    self.btnStore = self.builder.get_object("btnStore")
    self.btnAdd = self.builder.get_object("btnAdd")
    self.btnGetName = self.builder.get_object("btnGetName")
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  3. #13
    Join Date
    Sep 2009
    Location
    Freiburg/Germany
    Beans
    1,112
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Good tool/IDE for GTK+python

    If you define the event handlers in Glade using the "Signals" properties you can use

    Code:
    self.builder.connect_signals(self)
    to automatically connect the event handlers to the corresponding methods of your class.
    ClassicMenu Indicator - classic GNOME menu for Unity
    Unsettings - configuration program for the Unity
    Privacy Indicator - easily switch privacy settings in Unity
    Arronax - create and modify app starters

  4. #14
    Join Date
    Jun 2008
    Location
    Malaysia
    Beans
    140
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Good tool/IDE for GTK+python

    Quote Originally Posted by diesch View Post
    http://www.micahcarrick.com/12-24-20...al-part-1.html has examples in C and Python - just ignore the C parts.



    That's just a matter of taste. All the event handling and business logic stuff is the same for both ways.
    Thanks for this, I'll surely try it out. I can't believe I've not done any 'Hello World' since I moved to Ubuntu.

    I started checking out QT but suspect GTK+ might just be the way.

    Thanks once again for the guide.
    "The collection of people, hardware, and software --Internet.
    Let us assume for a moment that such a network has been formed." - J. C. R. Licklider, Robert Taylor, 1968.
    Linux Registered User #511228! Ubuntu Registered User #31414

Page 2 of 2 FirstFirst 12

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
  •