def show(postId): panel=gui.get_closable_tab(u"会話",True) layout=wx.BoxSizer(wx.VERTICAL) tl=timeline.Timeline(panel,False) posts=config.misskey.reqr("posts/talk/show",{"post-id":postId,"limit":50}) for post in posts: tl.append_post(post) post=config.misskey.reqr("posts/show",{"post-id":postId}) tl.append_post(post) layout.Add(tl,1,wx.EXPAND) panel.SetSizer(layout)
def show2(a): user=a[0] posts=a[1] panel=gui.get_closable_tab("@"+user["screenName"],True) panel.SetupScrolling() layout=wx.BoxSizer(wx.VERTICAL) user_layout=wx.BoxSizer(wx.HORIZONTAL) user_layout.Add(wx.StaticBitmap(panel,-1,filemng.cacheBmp(user["avatarUrl"]+"?size=120&quality=100"))) user_layout.AddSpacer((20,2)) user_info_layout=wx.FlexGridSizer(6,3) user_info_layout.Add(wx.StaticText(panel,label=user["name"]),flag=wx.ALIGN_RIGHT) user_info_layout.AddSpacer((10,1)) user_info_layout.Add(wx.StaticText(panel,label="@"+user["screenName"])) user_info_layout.Add(wx.StaticText(panel,label=str(user["postsCount"])),flag=wx.ALIGN_RIGHT) user_info_layout.AddSpacer((10,1)) user_info_layout.Add(wx.StaticText(panel,label=u"投稿")) user_info_layout.Add(wx.StaticText(panel,label=str(user["likesCount"])),flag=wx.ALIGN_RIGHT) user_info_layout.AddSpacer((10,1)) user_info_layout.Add(wx.StaticText(panel,label=u"ふぁぼ")) user_info_layout.Add(wx.StaticText(panel,label=str(user["likedCount"])),flag=wx.ALIGN_RIGHT) user_info_layout.AddSpacer((10,1)) user_info_layout.Add(wx.StaticText(panel,label=u"ふぁぼられ")) user_info_layout.Add(wx.StaticText(panel,label=str(user["followingCount"])),flag=wx.ALIGN_RIGHT) user_info_layout.AddSpacer((10,1)) user_info_layout.Add(wx.StaticText(panel,label=u"フォロー")) user_info_layout.Add(wx.StaticText(panel,label=str(user["followersCount"])),flag=wx.ALIGN_RIGHT) user_info_layout.AddSpacer((10,1)) user_info_layout.Add(wx.StaticText(panel,label=u"フォロワー")) user_layout.Add(user_info_layout) layout.Add(user_layout) tl=timeline.Timeline(panel) posts.reverse() for post in posts: tl.prepend_post(post) layout.Add(tl,1,wx.EXPAND) panel.SetSizer(layout)
def show(path): panel = gui.get_closable_tab("pic", True) panel.SetupScrolling() layout = wx.BoxSizer(wx.VERTICAL) layout.Add(wx.StaticBitmap(panel, -1, filemng.cacheBmpfromLocal(path))) panel.SetSizer(layout)