Python Glade : Connection between label and button
Python Glade : Connection between label and button
(Screen Shot)
*******************************************
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class Handler:
def OnShowClick(self,button):
x.builder.get_object("label1").show_all()
def OnChangeClick(self,button):
x.builder.get_object("label1").set_text("My name is khafi")
def OnHideClick(self,button):
x.builder.get_object("label1").hide_on_delete()
def OnExitClick(self,button):
x.builder.get_object("window1").destroy()
class Example:
def __init__(self):
self.builder = Gtk.Builder()
self.builder.add_from_file("Khafi.glade")
self.builder.connect_signals(Handler())
window = self.builder.get_object("window1")
window.show_all()
def main(self):
Gtk.main()
x = Example()
x.main()
********************* End Project *************************
(Screen Shot)
*******************************************
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class Handler:
def OnShowClick(self,button):
x.builder.get_object("label1").show_all()
def OnChangeClick(self,button):
x.builder.get_object("label1").set_text("My name is khafi")
def OnHideClick(self,button):
x.builder.get_object("label1").hide_on_delete()
def OnExitClick(self,button):
x.builder.get_object("window1").destroy()
class Example:
def __init__(self):
self.builder = Gtk.Builder()
self.builder.add_from_file("Khafi.glade")
self.builder.connect_signals(Handler())
window = self.builder.get_object("window1")
window.show_all()
def main(self):
Gtk.main()
x = Example()
x.main()
********************* End Project *************************
Comments
Post a Comment