How to add a SliderBar to a panel instead of RootPanel?

42 views
Skip to first unread message

rahul sanghi

unread,
Apr 16, 2011, 3:10:06 PM4/16/11
to Google Web Toolkit, dhiraj....@gmail.com
I am trying to develop a HTML5 based player. Wanted to know how we can
add the Slider bar to a Panel and add this Panel to the RootPanel
instead of adding it directly to the RootPanel.
The SliderBar doesnt work/render properly when i try to do the former,
but works perfectly when i try to add it directly to the RootPanel.
I am using Firefox browser. Please let me know any workaround, or if i
am missing out on something!

Here's my code snippet:

SliderBar slider = new SliderBar(0.0, 100);
slider.setStepSize(10);
slider.setCurrentValue(5);
slider.setNumTicks(10);
slider.setNumLabels(10);
slider.setWidth("100%");
slider.redraw();

//TODO Create playButton, stopButton, timeLabel,
fullSreenButton
//TODO Assemble playStopPanel. horizontal
playControlPanel.add(playPauseButton);
playControlPanel.add(stopButton);
playControlPanel.add(volumeButton);
playControlPanel.add(timeLabel);
playControlPanel.add(fullScreenButton);
//playControlPanel.add(progressBar);
playControlPanel.setWidth("100%");
playControlPanel.add(slider);

// TODO Assemble Main panel.
mainPanel.add(playControlPanel);

// TODO Associate the Main panel with the HTML host page.
RootPanel.get("playerPanel").add(mainPanel);//doesnt render
properly
RootPanel.get("playerPanel").add(slider);//works fine

Thanks!
Rahul

Rahul Sanghi

unread,
Apr 18, 2011, 5:53:02 PM4/18/11
to Google Web Toolkit, dhiraj peechara
Hello

I am using the native gwt canvas and video.
I wanted to know if there's anyway in which i can add a Video to a Canvas (HTML5) in GWT so that i do not 
need to hide canvas &/or video alternatively.

Thanks and Regards

Rahul Sanghi

David Chandler

unread,
Apr 18, 2011, 7:39:19 PM4/18/11
to google-we...@googlegroups.com, dhiraj....@gmail.com
SliderBar in the gwt-incubator souce is pretty out of date. I modernized it a bit (work in progress at link below), but it still needs major refactoring in order to work with cell widgets. If you're seeing layout issues with the SliderBar, you might just need to let SliderBar implement RequiresResize and do this:


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.




--
David Chandler
Developer Programs Engineer, Google Web Toolkit
w: http://code.google.com/
b: http://googlewebtoolkit.blogspot.com/
t: @googledevtools
Reply all
Reply to author
Forward
0 new messages