ousia
(Pablo RodrĂguez)
1
I have the following sample:
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
import time
page_number = 0
window = Gtk.Window()
window.set_title("Page "+ str(page_number+1))
window.show_all()
Gtk.main()
In my project, the value of page_number
will increase.
Sorry for the very basic question, but how can I make that the window title gets the updated value?
Many thanks for your help.
ousia
(Pablo RodrĂguez)
2
Sorry, but coding is almost all Greek to me.
I found a dirty hack:
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
import time
page_number = 0
window = Gtk.Window()
window.set_title("Page "+ str(page_number+1))
window.show_all()
window.fullscreen()
page_number = 1000
window.unfullscreen()
window.set_title("Page "+ str(page_number+1))
Gtk.main()
It seems that repeating set_title()
does the job.
Even as a newbie coder, the workaround looks crappy to me.
Is there no more elegant way of resetting the window title?
Many thanks for your help.
zbrown
(Zander Brown)
3
Why? Setting the title when you want/need to set the title seems fine to me?
Of course eventually you may use properties/signals, but ultimately it’s always going to be setting :title
1 Like
ousia
(Pablo RodrĂguez)
4
Many thanks for your reply, Zander.
Probably I should read what properties and signals are and how could be handled.
But that would be for the next project .
Many thanks for your help.
1 Like
MichiB
(Michael Buzgaru)
5
After you read the main documentation, you could take a look here. There are two playlists dedicated to Signals and properties.
ousia
(Pablo RodrĂguez)
6
Many thanks for your reply, @MichiB.
I won’t be able to read C code (I hardly read Python and Lua), but your videos are great for me to grasp the basic meaning of the concepts at stake.
Many thanks for your help.
1 Like
system
(system)
Closed
7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.