Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6804889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:31:16+00:00 2026-05-26T19:31:16+00:00

After going through the PyGTK libraries and tutorials, I haven’t managed to find an

  • 0

After going through the PyGTK libraries and tutorials, I haven’t managed to find an exact answer I’m looking for, or maybe I’m just doing something wrong…

Anyway, I’m learning PyGTK and Glade, I’m in the process of scripting a simple downloader application. The GUI of the application has three check boxes, and then a submit button.

What I’m trying to do is get the status of the check boxes after the submit button is pressed, that way I can continue my script to download applications based on whether the checkboxes are true or false.

Here’s what I have so far. (Still very early stages and learning from mistakes)

Python Script:

import sys
try:
    import pygtk
    pygtk.require("2.0")
except:
    pass
try:
    import gtk
    import gtk.glade
except:
    sys.exit(1)


class GladeTest:

    def __init__(self):

        #Set the Glade file
            filename = "gui.glade"
            builder = gtk.Builder()
            builder.add_from_file(filename)
            builder.connect_signals(self)

        #Create our dictionay and connect it
            dic = { "btnSubmit_clicked" : self.btnSubmit_clicked,
            "chkboxDropbox_toggled" : self.chkboxDropbox_toggled,
            "MainWindow_destroy" : gtk.main_quit }

        def btnSubmit_clicked(self, widget):
            self.button = gtk.ToggleButton("chkboxDropbox_toggled")
            status = self.button.get_active()
            print status

        def chkboxDropbox_toggled(self, widget):
            print ""




if __name__ == "__main__":
    hwg = GladeTest()
    gtk.main()

Glade 3 XML (gui.glade):

<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <requires lib="gtk+" version="2.24"/>
  <!-- interface-naming-policy project-wide -->
  <object class="GtkAction" id="action1"/>
  <object class="GtkWindow" id="MainWindow">
    <property name="visible">True</property>
    <property name="can_focus">False</property>
    <property name="title" translatable="yes">MainWindow</property>
    <property name="resizable">False</property>
    <property name="window_position">center</property>
    <signal name="destroy" handler="MainWindow_destroy" swapped="no"/>
    <child>
      <object class="GtkVBox" id="vbox1">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <child>
          <object class="GtkLabel" id="label1">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="label" translatable="yes">Downloader</property>
            <attributes>
              <attribute name="style" value="normal"/>
              <attribute name="size" value="300"/>
            </attributes>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">0</property>
          </packing>
        </child>
        <child>
          <object class="GtkCheckButton" id="chkboxDropbox">
            <property name="label" translatable="yes">Dropbox</property>
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="receives_default">False</property>
            <property name="use_action_appearance">False</property>
            <property name="draw_indicator">True</property>
            <signal name="toggled" handler="chkboxDropbox_toggled" swapped="no"/>
            <signal name="activate" handler="chkboxDropbox_active" swapped="no"/>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">1</property>
          </packing>
        </child>
        <child>
          <object class="GtkCheckButton" id="chkboxPython">
            <property name="label" translatable="yes">Python</property>
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="receives_default">False</property>
            <property name="use_action_appearance">False</property>
            <property name="draw_indicator">True</property>
            <signal name="toggled" handler="chkboxPython_checked" swapped="no"/>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">2</property>
          </packing>
        </child>
        <child>
          <object class="GtkCheckButton" id="chkboxChrome">
            <property name="label" translatable="yes">Google Chrome</property>
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="receives_default">False</property>
            <property name="use_action_appearance">False</property>
            <property name="draw_indicator">True</property>
            <signal name="toggled" handler="chkboxChrome_checked" swapped="no"/>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">3</property>
          </packing>
        </child>
        <child>
          <object class="GtkButton" id="btnSubmit">
            <property name="label" translatable="yes">Download/Run</property>
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="receives_default">True</property>
            <property name="use_action_appearance">False</property>
            <signal name="clicked" handler="btnSubmit_clicked" swapped="no"/>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">4</property>
          </packing>
        </child>
      </object>
    </child>
  </object>
</interface>

Either I can’t find the proper method of calling for the status, or I have found it and I’m just using it wrong… Any help is greatly appreciated, thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:31:17+00:00Added an answer on May 26, 2026 at 7:31 pm

    you just need to call “get_active” method of gtk checkbox, get object of check button from glade file and call “get_active” method on click event of submit button.

    here, code snippet to be more descriptive:

    class GladeTest:
    
        def __init__(self):
    
            #Set the Glade file
            filename = "gui.glade"
            self.builder = gtk.Builder()
            self.builder.add_from_file(filename)
            self.builder.connect_signals(self)
    
            #Create our dictionay and connect it
            dic = { "btnSubmit_clicked" : self.btnSubmit_clicked,
            "chkboxDropbox_toggled" : self.chkboxDropbox_toggled,
            "MainWindow_destroy" : gtk.main_quit }
    
        def btnSubmit_clicked(self, widget):
            chkbt_chrome = self.builder.get_object("chkboxChrome")
            print "ACTIVE--",chkbt_chrome.get_active()
            # do same for rest of the check buttons
    
            self.button = gtk.ToggleButton("chkboxDropbox_toggled") # if used for check box status then there is no need for this button.
    
            status = self.button.get_active()
            print status
    
        def chkboxDropbox_toggled(self, widget):
            print ""
    
    
    if __name__ == "__main__":
        hwg = GladeTest()
        gtk.main()
    

    hope, it would help you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to android and after going through many tutorials I still can't
I am just getting into xslt transformation and after going through a tutorial I
After going through some tutorials on asp.net mvc the repository pattern came up and
After going through tutorials on getting started with Tortoise I am finally starting to
after going through some basic tutorials on the app engine and the webapp framework,
I am new to symfony, after going through several online tutorials and blogs, i
After going through the Appendix A, C# Coding Style Conventions of the great book
Something is puzzling me, after going through my app with instruments, it is a
After searching online and going through past stackoverflow posts for a suitable implementation for
After going through Marshall code snippet Got the Idea that marshalling is used to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.