broadfield commited on
Commit
688fae6
·
verified ·
1 Parent(s): b3b21d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -62,19 +62,19 @@ def search(q,rn,st):
62
  return(json.dumps(cont,indent=4)),html
63
  def next_show(cur):
64
  new=int(cur)+10
65
- return gr.update(visible=True),new
66
 
67
  def prev_show(cur):
68
  if int(cur)-10 <=0:
69
  new=0
70
- out_gr=gr.update(visible=False)
71
  else:
72
  new=int(cur)-10
73
- out_gr=gr.update(visible=True)
74
  return out_gr,new
75
  def show_num(cur):
76
  new=int(cur)+10
77
- html_out=f"<div>Showing {cur} through {new}</div>"
78
  return html_out
79
 
80
  with gr.Blocks(css=style,head=head) as b:
@@ -84,7 +84,7 @@ with gr.Blocks(css=style,head=head) as b:
84
  num=gr.Number(label="Count",step=1,value=10,interactive=False)
85
  sub=gr.Button()
86
  with gr.Row():
87
- prev_btn=gr.Button("Previous",visible=False)
88
  show_html=gr.HTML()
89
  next_btn=gr.Button("Next")
90
  html_out=gr.HTML()
 
62
  return(json.dumps(cont,indent=4)),html
63
  def next_show(cur):
64
  new=int(cur)+10
65
+ return gr.update(interactive=True),new
66
 
67
  def prev_show(cur):
68
  if int(cur)-10 <=0:
69
  new=0
70
+ out_gr=gr.update(interactive=False)
71
  else:
72
  new=int(cur)-10
73
+ out_gr=gr.update(interactive=True)
74
  return out_gr,new
75
  def show_num(cur):
76
  new=int(cur)+10
77
+ html_out=f"<div><center>Showing {cur} through {new}</center></div>"
78
  return html_out
79
 
80
  with gr.Blocks(css=style,head=head) as b:
 
84
  num=gr.Number(label="Count",step=1,value=10,interactive=False)
85
  sub=gr.Button()
86
  with gr.Row():
87
+ prev_btn=gr.Button("Previous",interactive=False)
88
  show_html=gr.HTML()
89
  next_btn=gr.Button("Next")
90
  html_out=gr.HTML()