Re: widgets within widgets
It sounds like you want to implement the SourcesClickEvents class. Just implement that class, in your implementation just use button.addClickListener(). Of course, you'll need to bump the button out of your constructor and into scope. -luke On Mar 31, 12:59 pm, alanj alan.jame...@gmail.com wrote: Hi, I'm new to java gwt, so please be gentle :-) I'm wrapping a MyButton widget, which extends Button, inside another widget MyDiv which extends FlowPanel, to control styles etc. So: public class MyDiv extends FlowPanel { public MyDiv(){ super(); setStyle(); MyButton button = new MyButton(); this.add(button); } public MyDiv(String html) { super(); setStyle(); MyButton button = new MyButton(html); this.add(button); } private void setStyle(){ addStyleName(button); } etc.} Can I within this MyDiv class create an addClickListener(ClickListener listener) method - native to Button but not to FlowPanel - which simply passes a received listener over to the MyButton widget which can use it? So from somewhere else: newButton = new MyDiv(click me); newButton.addClickListener(new ClickListener(){ public void onClick(Widget widget) { //do something on click }}); gives div class=myDivinput type=button value=click me/div which does something on click Thanks in advance! Alanj --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Back Refresh button handling
You can not rely on this event being raised before the browser is closed. You can use the onunload=someJavascript() on your body tag and then some JSNI to call your google code. Here's the problem: the event gets raised, and you start doing your work. The window gets closed before you finish doing your work, and your rpc never completes and the server never knows. I'd say at best you get a 50% success rate with the window close events :) -luke On Mar 26, 3:58 pm, bigtruckdriver adam.ludg...@gmail.com wrote: I'm in a similar predicament, perhaps you might have an idea of what to do. When the user closes the browser window, I want the application to logout his/her session automatically so as to free up memory on the server from their session. So I use the onWindowClosed() function to take care of this... But when the page is refreshed, the session gets logged out as well through the same function. This is something I want to stop from happening. Any suggestions? On Mar 15, 9:26 am, Rohit rohitsmart...@gmail.com wrote: Hi There is no way in GWT to distinguish betweenRefreshbuttonclick and Window closebuttonclick. But you can trackrefreshbuttonwith a little trick. You should use a time cookie which will expire after some time. So whenrefreshbuttonis pressed, in on module load of entry point , track the value of this cokkie, if this cookie is still alive, this meansrefreshbuttonis pressed. The time this cookie will expired should be considered. It should be very little. Second for history, you should save your information in Session on window close and then ifrefreshbuttonis pressed, get your information from this session. Thanks and regards Rohit On Mar 14, 2:30 am, levi.bracken levi.brac...@gmail.com wrote: You can restore state, but it's a bit more work than just using GWT History. Basically you'll need to come up with some way of modifying the url search parameter (stuff after the #) to include some info so that you can bring the userbackinto the same state as they were before. For example, if your application has a number of screens and they were on screen foo, which was loading with properties for an item with id 10 then you'd need that information in the Url. ex: http://yourApp.com/gwtHostPage.html#screen=foo_id=10 You could also put a conversation id in the url param and then keep the fine details cached on the server, but that makes the state/data more transient. If you go with an option like this though it can help make your pages open and work in other tabs and even make points in your application bookmark'able'. Now for the easy answer, yes you can just prevent the user from carelessly clickingrefresh. Fortunately there isn't a way to trap somebody on a webpage (think about how bad the web would be). But, you can use the WindowCloseListener to present a user with a confirmation before they close the window, navigate to a new page, or hitrefresh. It'd look something like this (not tested): / Window.addWindowCloseListener( new WindowCloseLisener(){ public String onWindowClosing(){ return Are you sure you want to leave this application?; } public void onWindowClosed(){ // Cleanup if need be }}); On Mar 13, 2:52 pm, dodo rajd...@gmail.com wrote: GWT provides History.onHistoryChange event to handle history but how can we restore application state when a user clicks onRefreshbutton? For example the user performed multiple actions on the web site and then clickedrefreshbutton. Now how using GWT History class we can restore the same state? Another question, is there a way to trap Refresh click before actually the app refreshes and can be cancel the event? Rajesh- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: RPC Performance/Response Problem
Have you tried using a List instead of an array? On Mar 26, 2:46 am, -Lord-67 -lord...@web.de wrote: First of all: Hi to everyone! I'm new to GWT and just programming my first app. Since i've some experience in Java it's not a big problem, but in this case i am stuck and hopefully someone can help me. In my app i make a RPC: On server side i get some data out of a database and save it into an array of type String. Up to 10.000 Strings atm, later on maybe up to 50.000. It is no problem so far. The server is handling this really fast. I measured 5 RPCs with about 500 Strings each and it took less time than 200 milliseconds each (SQL Statement + creating the array). The problem now is: I have to wait 5 SECONDS to get the results of the RPC (the String[] created on the server) on the client side so i can do something with them. Regarding the overall time i measured, these 5 seconds are more than 75% of the time which my app needs. Is it possible that the serialization and deserialization takes that much time? I don't think so and i have no clue where this 5 seconds come from. If someone has any ideas, solutions, suggestions on this problem i would appreciate any help! Thanks in advance, -Lord-67 P.s.: Of course i searched for a solution for this problem for hours, if i somehow just typed the wrong keywords to get the fitting results, just let me know and post a link :-). --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Flash with GWT
There's not much you can do about this :) This happens for the same reason that dropdown menus burn through 'popunders' like you describe. Try creating a new popup class that uses an IFRAME to show your element, and then it won't burn through to the second iframe. Sucks, yes. On Mar 26, 6:28 am, ping2ravi ping2r...@gmail.com wrote: Hi All, I have a web page where i am using Flash and GWT both, i am using GWT's popup thing. Non flash screen part of the page shows the popup correctly but the screen part where flash is, it hides the popup under it. I can see that the potion of popup which should be on the top of Flash part is hidden and the otehr part is visible as there is no flash on that part. I remember that in JS/CSS we used to use z-index kind of this to make such ordering of JS object, but how to do that with flash. Any comments/Suggestion? --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How to show waiting status in GWT web apps?
Alternatively, you may want to double-check that its fetching the data that's taking a long time (and not rendering it). Look into using IncrementalCommands to increase the apparent responsiveness of your UI. Also, look into using DeferredCommands when you need to show a spinner but it's not going to be completed at the end of an async method. On Mar 25, 1:07 am, Vikas vikas.m.ya...@gmail.com wrote: Hi All, In my GWT web application, while fetching data it takes some time, so for that period I want to show some waiting message like Fetching record... similar to gmail for e.g. when we click on inbox it shows Loading... status on first line till all mails fetched. How to achive this in GWT? --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Gilead tutorial
Giliead is used to serialize hibernate objects to the client and then get them back in sync once they get back to the server. Yes, you could just create POJOs that mirror your hibernate objects and use those instead, then sync then with your hibernate objects. On Mar 25, 6:53 am, Rafael Barrera Oro boraf...@gmail.com wrote: Howdy! I was wondering if anyone knew of a tutorial and/or introduction for Gilead, the reason i am asking you for this is that i read the official tutorial and i was not able to follow it completely (i should point that i can be considered a total nooboid in what regards GWT and related technologies, hibernate also) Speaking of nooboids, i was wandering if, instead of using Gilead, i could do the following... Consider i have a functional Hibernate project, i could extract the POJOs from the project and make them visible for the client side of a GWT application and perform all the heavy duty database work in async services, right? I guess that where i am going with this is that i am failing to see the goal of GILEAD, the reason it was created, the problems it aims to solve (although i am sure there are, i do not mean any disrespect to the Gilead project) thanks in advance yours trully Rafael Barrera Oro PS: If what i just said is so wrong that it hurted your front lobes please refrain from coming to my castle angrily waving pitchforks and torches around, just point it out in a respectful manner i will listen thankfully and bow my head in gratitude --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Working with compiled js files
That's a possibility, but really not maintainable like your java code and after the handoff takes place your java code becomes throw-away. Another solution is to let them code in native methods. private native void nativeMethod(String effect, Element element) /*-{ //write javascript here }-*/; On Mar 25, 8:06 am, logicpeters logicpet...@gmail.com wrote: Does anyone have experience working with the raw compiled (detailed / pretty) javascript that GWT produces? Is this a feasible option when you wish to hand off a GWT project to another team who prefers to work with javascript and has the expertise for that? --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How to use Servlets to download file to browser?
This looks like an operation that should use an RPC. This may help you: http://roberthanson.blogspot.com/2006/06/trivial-gwt-example.html On Mar 24, 1:06 pm, vroom_vroom slabarb...@gmail.com wrote: Hello, I know this topic has been discussed in a few threads. I have attempted to ask my questions in those but for some reason they are not posting, so I had to create this new one. I read documentation and other posts but still confused on how to do this. File download is very simple in normal web app, but having trouble in GWT. Can someone please help me with what I have written here? This is code for client side : [CODE] private void exportToExcel() { final int STATUS_CODE_OK = 200; final String url = /exportExcel; RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url); try { Request response = builder.sendRequest(null, new RequestCallback () { public void onError(Request request, Throwable exception) { // TODO: } public void onResponseReceived(Request request, Response response) { // TODO: } }); } catch (RequestException e) { // TODO: } } [/CODE] This is in the ***.gwt.xml file: [CODE] inherits name=com.google.gwt.http.HTTP / servlet path=/exportExcel class=com.myweb.server.ExportExcelServlet / [/CODE] This is my servlet: [CODE] package com.myweb.server; import java.io.ByteArrayInputStream; ... public class ExportExcelServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(application/download); response.setHeader(Content- Disposition,attachment;filename=temp.csv); try { StringBuffer sb = generateCsvFileBuffer(); InputStream in = new ByteArrayInputStream(sb.toString().getBytes (UTF-8)); ServletOutputStream out = response.getOutputStream(); byte[] outputByte = new byte[4096]; //copy binary contect to output stream while(in.read(outputByte, 0, 4096) != -1) { out.write(outputByte, 0, 4096); } in.close(); out.flush(); out.close(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request,response); } private static StringBuffer generateCsvFileBuffer() { StringBuffer writer = new StringBuffer(); writer.append(DisplayName); writer.append(','); writer.append(Age); writer.append('\n'); writer.append(your name); writer.append(','); writer.append(30); writer.append('\n'); return writer; }} [/CODE] At first I was having no errors generated but in the browser no download dialog would pop up, and nothing happened. I changed something...not sure what now, and getting runtime errors. [ERROR] Unable to find 'exportExcel.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source? My entire app is written in GWT, so I dont have a web.xml file I am very stuck any help would be extreemly appreciated Thanks! --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Keyboard event
Remember, when flaming a forum, not to use your real email address :) You can use the DOM and event listeners to manually monitor events. Just make sure to sink the events properly. http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/DOM.html On Mar 23, 3:31 am, nicanor.babula nicanor.bab...@gmail.com wrote: Very nice though... Useless forum... No help at all... I finally figured it out. But it doesn't worth sharing the solution with you... Thank you anyway for your help.. On Mar 20, 5:37 pm, nicanor.babula nicanor.bab...@gmail.com wrote: Hello everyone... This is my first post in here so don't be too sharp on me.. I have wrote a class that extends AbsolutePanel and implements SourcesMouseEvents in order to have an AbsolutePanel that accept mouse events. Now, the next step I want to do is to make it accept Keyboard events. I won't use any other component existing in other libraries (like extjs) because my app must be very light. So, you have any hint? Any tutorial? So far I could handle it just by reading the javadocs, but for this one I couldn't figure it out... Sorry for my poor english too.. --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Trying to change the style of tabTopLeft and right on tabBars
I've had mixed results with CSS inheritence (seems like sometimes IE just doesn't listen...) So here's the idea - Say I have three CSS classes, .test1 { border:1px solid red; } .test2 { background-color:blue; } .test1 .test2 { font-size:16pt; } and the following html: span class=test1test1/span span class=test2test2/span span class=test1span class=test2test3/span/span then I would expect the following: test1 will have a red border as it inherits the class .test1 test2 will have a blue background as it inherits the class .test2 test3 will have a red border, a blue background, AND MOST IMPORTANTLY, font size 16pt as it inherits the class .test1 .test2 (note the missing comma in .test1 .test2! its intentionally gone!) -lukehashj On Mar 20, 12:09 pm, ProtoLD protosh...@gmail.com wrote: All the other CSS styles are easily applied after setting a style name to the tab bar and addressing them as follows: .customizedStyleName .tabTopCenter { background-image: url('images/centerTopImage.gif'); } but this doesn't appear to work for the two corners, the base GWT overrides my CSS. The CSS for the right corner looks like this: html body .gwt-DecoratedTabBar .tabTopRight { when inspecting it in Firebug (yah Firefox). Can anyone tell me how to override 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Trying to change the style of tabTopLeft and right on tabBars
Sorry, didn't read your question thoroughly enough. It looks like you understand the css inheritence problem. Why not just use .gwt-DecoratedTabBar .tabTopRight { } as the CSS class? Do you have more than one tabbar this would effect? If so, could you wrap the tabbar in a container with a css class name, and then use: .container .gwt-DecoratedTabBar .tabTopRight { } Good luck. On Mar 20, 12:09 pm, ProtoLD protosh...@gmail.com wrote: All the other CSS styles are easily applied after setting a style name to the tab bar and addressing them as follows: .customizedStyleName .tabTopCenter { background-image: url('images/centerTopImage.gif'); } but this doesn't appear to work for the two corners, the base GWT overrides my CSS. The CSS for the right corner looks like this: html body .gwt-DecoratedTabBar .tabTopRight { when inspecting it in Firebug (yah Firefox). Can anyone tell me how to override 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Scroll to certain position
You have a few options. You can use the ScrollPanel class, and the setScrollBarPosition method. Or, you can use DOM.scrollIntoView(Element e) Good luck On Mar 22, 4:40 pm, maple...@gmail.com maple...@gmail.com wrote: im a newbie how could i scroll to the certain position in a panel? For example: Panel pagePanel = new Panel(); pagePanel.setHtml(aFile); When i click a button, the pagePanel will start to show the from the 10th line. --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How to mask page when show a dialog box ?
I did something like this: SimplePanel modalDiv = new SimplePanel(new HTML(nbsp;)); modalDiv.setStyleName(modalDiv); modalDiv.setWidth(100%); modalDiv.setHeight(100%); RootPanel.get().add(modalDiv); DOM.setStyleAttribute(modalDiv.getElement(), position, absolute); DOM.setStyleAttribute(modalDiv.getElement(), left, 0); DOM.setStyleAttribute(modalDiv.getElement(), top, 0); with css: .modalDiv { filter:alpha(opacity=90); -moz-opacity:.90; opacity:.90; } -luke On Mar 18, 12:34 am, Saeed Zarinfam zarinfa...@gmail.com wrote: Hi I want to mask page element when i show a dialog box over the page (like google reader message box). please guide me. --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How to mask page when show a dialog box ?
Forgot to include background-color:black in the css. On Mar 23, 5:03 pm, lukehashj bobwazn...@gmail.com wrote: I did something like this: SimplePanel modalDiv = new SimplePanel(new HTML(nbsp;)); modalDiv.setStyleName(modalDiv); modalDiv.setWidth(100%); modalDiv.setHeight(100%); RootPanel.get().add(modalDiv); DOM.setStyleAttribute(modalDiv.getElement(), position, absolute); DOM.setStyleAttribute(modalDiv.getElement(), left, 0); DOM.setStyleAttribute(modalDiv.getElement(), top, 0); with css: .modalDiv { filter:alpha(opacity=90); -moz-opacity:.90; opacity:.90; } -luke On Mar 18, 12:34 am, Saeed Zarinfam zarinfa...@gmail.com wrote: Hi I want to mask page element when i show a dialog box over the page (like google reader message box). please guide me. --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Problem with opening a new Window
This may help you: http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/eea48bafbe8eed63 On Mar 23, 5:44 am, Magius antonio.diaz@gmail.com wrote: Ummm, it seems complex. The DialogBox it's a layer placed on top of the current window, but it's part of the window and I don't know how to print only it (you could manipulate the rest of the elements using css to not print them but I think it not a good idea). Probably the best approach is to open another window with only the contents of the dialogBox. But you need to pass arguments to the new Window(date, action=showDetails, ...). One way is: 1. to open a new window with the URL of a generic jsp (.../ generic.jsp?date=xxxaction=showDetails...) 2. to generate in the jsp an GWT-HTML page with a additional js- variable storing the parameters. The page can use your current EntryPoint. 3. to modify the EntryPoint to check if the js-variable exists in the page and, in this case, to render only the DialogBox inside the Panel instead of starting the whole application. The parameters are available in the page. 4. to call to the print option of the navigator. Another way is: 1. to send to the server the parameters using RPC and to store them in session 2. to open a new window using a static GWT-HTML page (with a different tittle or an additional js-variable or anything that could be used as a flag). The page can use your current EntryPoint. 3. to modify the EntryPoint to check if the HTML page has the flag and, in this case, to render only the DialogBox inside the Panel instead of starting the whole application. The parameters are avialable in the user session. 4. to call to the print option of the navigator. There are more approach but I cannot imagine anyone more simple. I hope it helps! On Mar 22, 7:48 pm, susanne.p...@googlemail.com susanne.p...@googlemail.com wrote: I'm writing a programm with gwt in Eclipse. It is a calendar where you can add dates. I also implemented a method to show an overview of all dates. At the moment it is shown in a Dialogbox. Now I want that overview to be printed. So I have to questions 1. Can I print a dialogbox? If yes HOW? 2. If not: can I open a new window, where the overview is included? How can I do this? I saw the function Window.open (URL...) but how can I say what the URL is? I don't know what is the name of it. How to create a new Window? Can you give me a piece of code? Many questions and hopefully many answers. I hope you can help me Thanks for now --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Profiling browser memory usage in a GWT application
You can get the firebug plugin for firefox and compile your GWT project with the -style pretty flag. Firebug: http://getfirebug.com/js.html -style pretty: http://www.juixe.com/techknow/index.php/2006/07/15/generate-pretty-gwt-javascript/ On Dec 27 2008, 9:31 am, byhisdeeds byhisde...@gmail.com wrote: Hi. I have a GWT application that I want to try and reduce the size of the memory footprint in the browser. What can I use to look at the memory foot print dynamically in firefox (or IE) so I can see when my code is stressing the browser. John --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How do I make a pretty, easy to use button without making custom images for each one?
If you are able to use .pngs with a full alpha channel in your project (IE6 does not support them without a work-around - google 'ie6 png') you can have great success using images. If you only have a few different background colors on your site, than create a rounded corner - fill in the area that is the background with its appropriate color and leave the area that will form the face of the button transparent. Then, you can use those four rounded corners (in various colors) to round everything from buttons to containers. Simple set the background color of the button to be the color that you want it to be, and whala! Now you have buttons in any color :) To create the PrettyButton widget you can use a grid wrapped in a focus panel - just make sure to use setCellSpacing(0) and setCellPadding(0) on the grid. You can use the same method to create a PrettyCornersWidget that will take a widget as an argument, then wrap it in rounded corners. On Jan 2, 4:00 am, dduck anders.johansen.a...@gmail.com wrote: Hi, I would like to make a button that looks like this: (|| text ||) ...where ( is a rounded left-end of the button, ) is a rounded right- end of the button, || is a background and text can be specified e.g. at creation. Thus, all buttons of this type would share the same style, but not the same text on the face of it. Examples: (|| OK ||) (|| My very long button text ||) How would I go about this, without having to generate each individual button as an image in my drawing program? Anders --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---