本文整理汇总了Python中console.Console.show_message方法的典型用法代码示例。如果您正苦于以下问题:Python Console.show_message方法的具体用法?Python Console.show_message怎么用?Python Console.show_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类console.Console
的用法示例。
在下文中一共展示了Console.show_message方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pyFriscApplication
# 需要导入模块: from console import Console [as 别名]
# 或者: from console.Console import show_message [as 别名]
#.........这里部分代码省略.........
mi.add( g )
if handler:
mi.connect( 'activate', handler )
self.menu.append( mi )
# Application events
def on_activate( self, data ):
self.window = Gtk.ApplicationWindow( title = "pyFRISC IDE", type = Gtk.WindowType.TOPLEVEL )
self.window.set_name( 'app-window' )
self.window.set_border_width( 4 )
self.window.set_default_size( 1080, 700 )
self.window.set_icon_from_file( 'resources/icon.png' )
self.window.connect( 'delete-event', self.on_quit )
self.window.connect( 'key-press-event', self.on_keypress )
#self.window.connect( 'check-resize', self.on_resize )
self.init_menu()
self.init_header()
self.init_contents()
self.add_window( self.window )
style_provider = Gtk.CssProvider()
style_provider.load_from_path( './resources/styles.css' )
Gtk.StyleContext.add_provider_for_screen( Gdk.Screen.get_default(), style_provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION )
self.window.show_all()
self.console.show_message( 'pyFRISC IDE started.', 'info' )
self.initial_open()
def on_quit( self, window, event ):
if self.editor.is_content_changed():
self.show_ask_save_changes_dialog()
self.store_config()
# TODO: Change console size on maximize only
def on_state_change( self, element, window ):
w, h = self.window.get_size()
print( w, h )
self.paned.set_position( h - 300 )
#print( element, window )
# Button events
def on_open_click( self, element ):
self.open_file()
def on_new_click( self, element ):
self.new_file()
def on_save_click( self, element ):
self.save_file()
def on_save_as_click( self, element ):
self.save_file_as()
def on_assemble_click( self, element ):
if not self.config[ 'file_exists' ] or self.editor.is_content_changed():
self.show_ask_save_changes_dialog()