Because the panel doesn’t update when you move the timeline. You have to call a function to update the panel whenever the value changes, like when the depsgraph changes, but perhaps this may not be the most optimal solution.
This would be a nice case for the frame change handler:
import bpy
from bpy.types import Panel
class VIEW3D_PT_frame_test_panel(Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = "Test"
bl_label = "Test Current Frame"
def draw(self, context):
layout = self.layout
layout.prop(context.scene, "frame_current", text="Current Frame")
def frame_change_post_handler(scene):
# from this screen get the view 3D and tag it for refresh
for area in bpy.context.screen.areas:
if area.type == 'VIEW_3D':
area.tag_redraw()
# register the frame change handler
bpy.app.handlers.frame_change_post.append(frame_change_post_handler)
bpy.utils.register_class(VIEW3D_PT_frame_test_panel)