gtk-rs / gtk

DEPRECATED, use https://github.com/gtk-rs/gtk3-rs repository instead!
https://gtk-rs.org/
MIT License
1.24k stars 82 forks source link

Can someone help me with my application #1013

Closed kevekop closed 4 years ago

kevekop commented 4 years ago

i'm making an application and i would like to put the date and time on my lable... i made my application with glade and than trying to programe it with GTK

this is where i got sofar

" _import datetime import gi

gi.requireversion('Gtk', '3.0') from gi.repository import Gtk as gtk

class Main: def init(self): gladeFile = "main.glade" self.builder = gtk.Builder() self.builder.add_from_file(gladeFile) self.builder.connect_signals(self)

    window        = self.builder.get_object("Main")
    window.connect("delete-event", gtk.main_quit)
    window.show_all()
    window.set_decorated(False)

    dat = datetime.datetime.now()

    Label = self.builder.get_object("Date_And_Time")
    Label.set_text(dat)

def Switch_LED(self, switch, gparam):
    if switch.get_active():
        state = "Led_On"
    else:
        state = "Led_Off"
    print("Led_Switch was", state)

def Switch_Licht(self, switch, gparam):
    if switch.get_active():
        state = "Licht_on"
    else:
        state = "Licht_off"
    print("Licht_Switch was", state)

def Luik_Open(self, button):
    state = "Rolluik_open"
    print(state)

def Luik_Dicht(self, button):
    state = "Rolluik_dicht"
    print(state)

if name == 'main': main = Main() gtk.main() " ps. sorry if i am at the wrong place for asking

sdroege commented 4 years ago

Just like yesterday, this repository is for the Rust bindings of GTK and has nothing to do with Python.