0
나는 Rhythmbox 플러그인에서 작업 중이므로 진행 표시 줄이있는 대화 상자를 표시해야합니다.파이썬에서 진행 막대를 사용하여 대화 창을 표시하는 방법
def download_all_lyrics_action_callback(self, action):
progressbar = Gtk.ProgressBar();
dialog = Gtk.Dialog(_('lLyrics Preferences'), self.shell.get_property('window'),
Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (Gtk.STOCK_OK, Gtk.ResponseType.OK))
content_area = dialog.get_content_area()
content_area.pack_start(progressbar, True, True, 0)
dialog.show_all()
dialog.run()
total = len(self.shell.props.library_source.props.query_model)
i = 1;
for row in self.shell.props.library_source.props.query_model:
entry = row[0]
title = entry.get_string(RB.RhythmDBPropType.TITLE)
artist = entry.get_string(RB.RhythmDBPropType.ARTIST)
print(title + " - " + artist)
self.get_lyrics_for_song(title, artist)
progressbar.set_fraction(i/total)
dialog.hide()
문제는이 dialog.run()
명령에 그만이다 다음은 내 코드입니다. 나는 발견했지만 성공하지 못한 코드도 테스트했다. 이 문제를 해결하도록 도와 주시겠습니까?