Python gtk 模块,MESSAGE_INFO 实例源码

我们从Python开源项目中,提取了以下20个代码示例,用于说明如何使用gtk.MESSAGE_INFO

项目:id_photo    作者:aeifn    | 项目源码 | 文件源码
def info(self, msg):
    infodialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, str(msg))
    infodialog.set_position(gtk.WIN_POS_CENTER_ALWAYS)
    infodialog.show_all()
    response_info= infodialog.run()
    if response_info == gtk.RESPONSE_OK:
      infodialog.hide()
      infodialog.destroy()

  # ??????? ??????? ??????????? ???? "? ?????????"
项目:hardened-centos7-kickstart    作者:fcaviggia    | 项目源码 | 文件源码
def show_help_main(self,args):
        self.help_text = ("<b>Install Help</b>\n\n- All LVM partitions need to take less than or equal to 100% of the LVM Volume Group.\n\n- Pressing OK prompts for a password to encrypt Disk (LUKS), GRUB, and admin password.\n\n- The sshusers group controls remote access, wheel group is for root users, and isso group is for limited root with auditing permissions.\n\n- To access root remotely via ssh you need to create a user and add them to the wheel and sshusers groups.\n\n- Minimum password length is 15 characters, using a strong password is recommended.\n")
                self.MessageBox(self.window,self.help_text,gtk.MESSAGE_INFO)


    # System Profile Configuration
项目:hardened-centos7-kickstart    作者:fcaviggia    | 项目源码 | 文件源码
def MessageBox(self,parent,text,type=gtk.MESSAGE_INFO):
                message = gtk.MessageDialog(parent,0,type,gtk.BUTTONS_OK)
        message.set_markup(text)    
        response = message.run()
        if response == gtk.RESPONSE_OK:
            message.destroy()


    # Get Password
项目:colorize    作者:BruXy    | 项目源码 | 文件源码
def python_colorize(image, layer):
    """Colorize plugin"""
    image.disable_undo()
    print(image, layer)
    colorize.check_api_key()

    # 1. Save actual image to GIMP TEMP direcotry as PNG
    bw_photo = save_tmp_file(image, layer, image.filename)
    print("Temp file saved in: " + bw_photo)
    gimpfu.gimp.progress_init("Uploading image for processing.")

    # 2. Upload file to the server
#    gui_message(
#        "Image is being processed at <u>{0}</u>.\nIt may take a while.".format(colorize.URL), 
#        gtk.MESSAGE_INFO
#    )
# TODO: information window that data are uploaded. 
    download_url =  colorize.upload_image(bw_photo)
    if download_url == '': # if empty => error
        gui_message(colorize.ALG_API_ERR, gtk.MESSAGE_ERROR)
        gimpfu.gimp.quit()
    else:
        print("download_url: " + download_url)

    # 3. Download it from the server
    if download_url:
         color_photo = colorize.download_image(download_url, bw_photo)

    # 4. Display result as a new image
    if color_photo:
        gimpfu.gimp.Display(
            gimpfu.pdb.file_png_load(color_photo, color_photo)
        )
        gimpfu.gimp.progress_init("Colorized data received...")

    image.enable_undo()


####################
# Plug-in register #
####################
项目:Web-Stalker    作者:Dylan-halls    | 项目源码 | 文件源码
def saver(self, text):
      file_name = save_bar.get_text()
      start_iter = textbuffer.get_start_iter()
      end_iter = textbuffer.get_end_iter()
      file_data = textbuffer.get_text(start_iter, end_iter, True)  
      with open('Reports/'+file_name, 'w') as file:
         file.write(file_data)
         file.close()
      done = gtk.MessageDialog(None, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, gtk.BUTTONS_OK)
      done.set_markup("<big><b>File {} Has Been Saved</b></big>".format(file_name))
      done.run()
项目:tools    作者:denglouping    | 项目源码 | 文件源码
def show_message(message,title):
    message_dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, None);
    message_dialog.set_markup(message);
    message_dialog.set_title(title)
    message_dialog.run();

#?????dialog
项目:ecel    作者:ARL-UTEP-OC    | 项目源码 | 文件源码
def show_alert_message(parent_window, msg):
    alert = gtk.MessageDialog(parent_window, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO,
                              gtk.BUTTONS_CLOSE, msg)
    alert.run()
    alert.destroy()
项目:ecel    作者:ARL-UTEP-OC    | 项目源码 | 文件源码
def parse_all(self, event):
        for collector in self.engine.collectors:
            collector.parser.parse()
#        alert = gtk.MessageDialog(self, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO,
#                                       gtk.BUTTONS_CLOSE, "Parsing complete")
#        alert.run()
#        alert.destroy()
项目:ecel    作者:ARL-UTEP-OC    | 项目源码 | 文件源码
def show_confirmation_dialog(self, msg):
        dialog = gtk.MessageDialog(self, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO,
                                      gtk.BUTTONS_YES_NO, msg)
        response = dialog.run()
        dialog.destroy()

        if response == gtk.RESPONSE_YES:
            return True

        return False
项目:Micro-Pi    作者:Bottersnike    | 项目源码 | 文件源码
def message(message, parent=None):
    dia = gtk.MessageDialog(parent, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, message)
    dia.show()
    dia.run()
    dia.destroy()
    return False
项目:Micro-Pi    作者:Bottersnike    | 项目源码 | 文件源码
def message(self, message):
        dia = gtk.MessageDialog(self.window, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, message)
        dia.show()
        dia.run()
        dia.destroy()
        return False
项目:PiJuice    作者:PiSupply    | 项目源码 | 文件源码
def show_about(self, widget):
        dialog = gtk.MessageDialog(
            None,
            gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
            gtk.MESSAGE_INFO,
            gtk.BUTTONS_OK,
            """
PiJuice battery 
level status
""")
        dialog.run()
        dialog.destroy()
项目:PiJuice    作者:PiSupply    | 项目源码 | 文件源码
def show_about(self, widget):
        dialog = gtk.MessageDialog(
            None,
            gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
            gtk.MESSAGE_INFO,
            gtk.BUTTONS_OK,
            """
PiJuice battery 
level status
""")
        dialog.run()
        dialog.destroy()
项目:PiJuice    作者:PiSupply    | 项目源码 | 文件源码
def show_about(self, widget):
        dialog = gtk.MessageDialog(
            None,
            gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
            gtk.MESSAGE_INFO,
            gtk.BUTTONS_OK,
            """
PiJuice battery 
level status
""")
        dialog.run()
        dialog.destroy()
项目:PiJuice    作者:PiSupply    | 项目源码 | 文件源码
def show_about(self, widget):
        dialog = gtk.MessageDialog(
            None,
            gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
            gtk.MESSAGE_INFO,
            gtk.BUTTONS_OK,
            """
PiJuice battery 
level status
""")
        dialog.run()
        dialog.destroy()
项目:PiJuice    作者:PiSupply    | 项目源码 | 文件源码
def show_about(self, widget):
        dialog = gtk.MessageDialog(
            None,
            gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
            gtk.MESSAGE_INFO,
            gtk.BUTTONS_OK,
            """
PiJuice battery 
level status
""")
        dialog.run()
        dialog.destroy()
项目:griffith    作者:Strit    | 项目源码 | 文件源码
def info(msg, parent=None):
    if mac:
        macutils.createAlert(msg)
    else:
        dialog = gtk.MessageDialog(parent,
                gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
                gtk.MESSAGE_INFO, gtk.BUTTONS_OK, msg)
        dialog.set_skip_taskbar_hint(False)
        dialog.run()
        dialog.destroy()
项目:wahcade    作者:sairuk    | 项目源码 | 文件源码
def show_msg_dialog(self, dlg_type=gtk.MESSAGE_INFO, dlg_buttons=gtk.BUTTONS_OK, msg=None):
        """display a MessageDialog"""
        mdlg = gtk.MessageDialog(type=dlg_type, buttons=dlg_buttons, message_format=msg)
        resp = mdlg.run()
        mdlg.destroy()
        #done
        return resp

    #map getitem to getattr
项目:chirp_fork    作者:mach327    | 项目源码 | 文件源码
def _updates(self, version):
        if not version:
            return

        if version == CHIRP_VERSION:
            return

        LOG.info("Server reports version %s is available" % version)

        # Report new updates every seven days
        intv = 3600 * 24 * 7

        if CONF.is_defined("last_update_check", "state") and \
           (time.time() - CONF.get_int("last_update_check", "state")) < intv:
            return

        CONF.set_int("last_update_check", int(time.time()), "state")
        d = gtk.MessageDialog(buttons=gtk.BUTTONS_OK, parent=self,
                              type=gtk.MESSAGE_INFO)
        d.set_property("text",
                       _("A new version of CHIRP is available: " +
                         "{ver}. ".format(ver=version) +
                         "It is recommended that you upgrade, so " +
                         "go to http://chirp.danplanet.com soon!"))
        d.run()
        d.destroy()
项目:fluxgui    作者:xflux-gui    | 项目源码 | 文件源码
def display_no_zipcode_or_latitude_error_box(self):
        md = gtk.MessageDialog(self.window,
                gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO,
                gtk.BUTTONS_OK, "The f.lux indicator applet needs to know " +
                "your latitude or zipcode to run. " +
                "Please fill either of them in on the preferences screen "+
                "and click 'Close'.")
        md.set_title("f.lux indicator applet")
        md.run()
        md.destroy()