本文整理汇总了Python中view.View.show方法的典型用法代码示例。如果您正苦于以下问题:Python View.show方法的具体用法?Python View.show怎么用?Python View.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类view.View
的用法示例。
在下文中一共展示了View.show方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Client
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import show [as 别名]
class Client(object):
def __init__(self):
self.app = Qt.QApplication(sys.argv)
self.__authWidget = AuthorizationWidget(self.authValidator)
self.__view = View(self.app)
self.__authWidget.show()
self.app.exec_()
def authValidator(self, login, password, server):
if login == "":
return "login is empty"
if password == "":
return "password is empty"
if login.replace(' ', '') == "":
return "login contains only spaces"
if server == "vkmessenger.com":
login += "@vk.com"
else:
if server == "gmail.com":
login += "@gmail.com"
else:
if server == "localhost":
login += "@localhost.ru"
self.__model = Model()
self.__view.setModel(self.__model)
self.__model.setView(self.__view)
if self.__model.auth(login, password, server):
self.__model.connect(login, password, server)
else:
return "login or password is invalid"
self.__authWidget.close()
self.__view.show()
return True
示例2: View
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import show [as 别名]
#!/usr/bin/env python
# coding=utf-8
import sys
from pyqtgraph import QtGui
import pyqtgraph as pg
from view import View
from presenter import Presenter
if __name__ == '__main__':
app = pg.mkQApp()
gui = View()
presenter = Presenter(gui)
gui.show()
sys.exit(app.exec_())
示例3: main
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import show [as 别名]
def main():
app = QtGui.QApplication(sys.argv)
myapp = View()
myapp.show()
sys.exit(app.exec_())
示例4: resolver_thread
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import show [as 别名]
self.robot.write('ba -4')
def resolver_thread(self, objeto, data=None):
th = threading.Thread(target=objeto.solve)
th.start()
while th.is_alive():
self.view.setTxtSolver(objeto.get_status())
time.sleep(0.1)
# creo que ya no existe el objeto
self.view.setTxtSolver('Terminado')
#self.view.setTxtSolver(objeto.get_stdout()+'Terminado')
if __name__ == "__main__":
#" Fichero de configuracion
settings = Settings("config.json")
controller = Controller(settings)
# Gtk.main()
view = View(controller)
view.show()
gtk.gdk.threads_enter()
gtk.main()
gtk.gdk.threads_leave()
示例5: Tab
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import show [as 别名]
class Tab(gtk.VBox):
def __init__(self):
super(type(self), self).__init__()
self._state = TAB_STATE_NORMAL
self._not_editable = False
self._save_flags = 0
self._ask_if_externally_modified = True;
# Create the scrolled window
sw = gtk.ScrolledWindow()
self._view_scrolled_window = sw
sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
self._auto_save_timeout = 0 # Not Implemented
#TODO:
# /* Manage auto save data */
# lockdown = gedit_app_get_lockdown (gedit_app_get_default ());
# tab->priv->auto_save = gedit_prefs_manager_get_auto_save () &&
# !(lockdown & GEDIT_LOCKDOWN_SAVE_TO_DISK);
# tab->priv->auto_save = (tab->priv->auto_save != FALSE);
# tab->priv->auto_save_interval = gedit_prefs_manager_get_auto_save_interval ();
# if (tab->priv->auto_save_interval <= 0)
# tab->priv->auto_save_interval = GPM_DEFAULT_AUTO_SAVE_INTERVAL;
doc = Document()
doc.set_data(TAB_KEY, self)
self._document = doc
# _gedit_document_set_mount_operation_factory (doc,
# tab_mount_operation_factory,
# tab);
self._view = View(doc)
self._view.show()
self._view.set_data(TAB_KEY, self)
self.pack_end(sw, True, True, 0)
# gtk_box_pack_end (GTK_BOX (tab), sw, TRUE, TRUE, 0);
sw.add(self._view)
# gtk_container_add (GTK_CONTAINER (sw), tab->priv->view);
sw.set_shadow_type(gtk.SHADOW_IN)
# gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
# GTK_SHADOW_IN);
sw.show()
self._scrolledwindow = sw
# gtk_widget_show (sw);
# g_signal_connect (doc,
# "notify::uri",
# G_CALLBACK (document_uri_notify_handler),
# tab);
# g_signal_connect (doc,
# "modified_changed",
# G_CALLBACK (document_modified_changed),
# tab);
# g_signal_connect (doc,
# "loading",
# G_CALLBACK (document_loading),
# tab);
# g_signal_connect (doc,
# "loaded",
# G_CALLBACK (document_loaded),
# tab);
# g_signal_connect (doc,
# "saving",
# G_CALLBACK (document_saving),
# tab);
# g_signal_connect (doc,
# "saved",
# G_CALLBACK (document_saved),
# tab);
# g_signal_connect_after (tab->priv->view,
# "focus-in-event",
# G_CALLBACK (view_focused_in),
# tab);
# g_signal_connect_after (tab->priv->view,
# "realize",
# G_CALLBACK (view_realized),
# tab);
def load(self, uri, encoding, line_pos, create):
print "[DEBUG] load(",uri,",",encoding,",",line_pos,",",create,")"
# g_return_if_fail (tab->priv->state == GEDIT_TAB_STATE_NORMAL);
doc = self.get_document()
if doc == None:
#.........这里部分代码省略.........