--- deliantra/Deliantra-Client/bin/pclient 2006/04/11 14:04:27 1.69 +++ deliantra/Deliantra-Client/bin/pclient 2006/04/11 17:02:36 1.71 @@ -33,6 +33,8 @@ our $HEIGHT; our $FULLSCREEN; +our $NOW; + our $MAPWIDGET; our $FONTSIZE; @@ -113,9 +115,15 @@ # Test code #d# unless ($tw) { # haha... - $te = new CFClient::Widget::FancyFrame x => 300, z => 1; - $te->add (new CFClient::Widget::Entry); - $CFClient::Widget::TOPLEVEL->add ($te); + my $w = new CFClient::Widget::Window + w => 300, h => 300, + child => (my $frame = new CFClient::Widget::FancyFrame); + $CFClient::Widget::TOPLEVEL->add ($w); + + $frame->add (my $vbox = new CFClient::Widget::VBox); + + $vbox->add (new CFClient::Widget::Entry text => "hallo"); + $vbox->add (new CFClient::Widget::Slider); $tw = new CFClient::Widget::Animator x => $WIDTH - 200, w => 600, h => 300; my $lbl1 = new CFClient::Widget::Label text => "This is a\nTEST!\nOf a themed\nFrame!"; @@ -199,15 +207,15 @@ sub refresh { $refresh_handler ||= add Glib::Idle sub { if ($SDL_APP) { - my $next_refresh = SDL::GetTicks; + $NOW = SDL::GetTicks; - if ($next_refresh - $last_refresh < $TICKS_PER_FRAME) { - SDL::Delay $TICKS_PER_FRAME - ($next_refresh - $last_refresh); - $next_refresh = SDL::GetTicks; + if ($NOW - $last_refresh < $TICKS_PER_FRAME) { + SDL::Delay $TICKS_PER_FRAME - ($NOW - $last_refresh); + $NOW = SDL::GetTicks; } - my $interval = ($next_refresh - $last_refresh) * 0.001; - $last_refresh = $next_refresh; + my $interval = ($NOW - $last_refresh) * 0.001; + $last_refresh = $NOW; if ($interval) { $FPS ||= 1 / $interval; @@ -275,7 +283,7 @@ CFClient::Widget::feed_sdl_button_up_event ($SDL_EV); }, SDL_ACTIVEEVENT() => sub { - printf "active %x %x\n", $SDL_EV->active_gain, $SDL_EV->active_state;#d# +# printf "active %x %x\n", $SDL_EV->active_gain, $SDL_EV->active_state;#d# }, );