Search Results

Search found 4668 results on 187 pages for 'font'.

Page 171/187 | < Previous Page | 167 168 169 170 171 172 173 174 175 176 177 178  | Next Page >

  • Facebook call back function with timeout

    - by Dirty Bird Design
    So I've been getting my ass kicked pretty good with Facebook's moving target of an API. I need to display some hidden content after a person clicks 'like' on a landing page. I can somewhat get this to work, when the user clicks 'like' the normal fb dialogue appears and then goes away immediately and content is displayed. I have 'achieved' this with the following js. <script> FB.Event.subscribe('edge.create', function(href, widget) { document.getElementById('goodies').style.display = "block"; document.getElementById('fb-content').style.display= "block"; document.getElementById('copy').style.display = "none"; }); </script> I cannot find any documentation about a callback event after someone hits "post to facebook" or after the dialogue closes, only afte they hit like. How would I incorporate a setTimeout function into this to give people some time to fill out the fb dialogue? thanks. If anyone has a better way to do this I'm all ears. This is for a business page and I cannot seem to add an app to get an app ID anymore so the API is pretty useless to me at this point. Also, if the url to be liked is a fb page, the callbacks don't seem to fire. Other code used: <html xmlns:fb="http://ogp.me/ns/fb#"> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <fb:like href="onlynonfburl.com" send="false" layout="button_count" width="450" show_faces="false" font="arial"></fb:like>

    Read the article

  • rails + paperclip: Is a generic "Attachment" model a good idea?

    - by egarcia
    On my application I've several things with attachments on them, using paperclip. Clients have one logo. Stores can have one or more pictures. These pictures, in addition, can have other information such as the date in which they were taken. Products can have one or more pictures of them, categorized (from the font, from the back, etc). For now, each one of my Models has its own "paperclip-fields" (Client has_attached_file) or has_many models that have attached files (Store has_many StorePictures, Product has_many ProductPictures) My client has also told me that in the future we might be adding more attachments to the system (i.e. pdf documents for the clients to download). My application has a rather complex authorization system implemented with declarative_authorization. One can not, for example, download pictures from a product he's not allowed to 'see'. I'm considering re-factoring my code so I can have a generic "Attachment" model. So any model can has_many :attachments. With this context, does it sound like a good idea? Or should I continue making Foos and FooPictures?

    Read the article

  • Inserting Row in Table inside Form tag autosubmitting in firefox/chrome

    - by user1861489
    I have a form that will have dynamic elements inserted with javascript and am experiencing some strange behavior. When I click the button to add another element to the table in the form, it adds the element but seems to to a form post immediately (without intending to submit the form yet) I have created a simplified example of the page that has the same behavior. the first table element is created on page load and subsequent elements are added when clicking on the button. this form works successfully in IE. does anyone have an idea of how to prevent this behavior? here is the code sample. <!DOCTYPE html> <html> <head> <title>Test Creating Form</title> <meta http-equiv="Content-type" content="text/html;charset=UTF-8"> <style type="text/css"> td{font-family:verdana;} </style> <script type="text/javascript"> var counter = 0; function makeTitle(title){ if(counter){ title += " " + counter; } counter++; var tbl = document.getElementById('tbl'); var tr = tbl.insertRow(-1) var td1 = tr.insertCell(-1); td1.innerHTML = title; } function load1(){ makeTitle('Primary Specimen'); } </script> </head> <body onload="load1();"> <form action="formtest.htm" method="post" name="testForm" id="testForm"> <table id="tbl" border="1"></table> <button onclick="makeTitle('Alternate Specimen')" id="clone" >Add Another Specimen</button> </form> </body> </html>

    Read the article

  • How to calculate how many lines (or records) can fit in the given page size

    - by devcoder
    My problem is to calculate the data (string) that can fit into the given page size (in inches). I have an application which creates plain vanilla HTML report without using any reporting controls. Now I have to provide paging support in this report. the report is dynamic in nature i.e. columns are decided at run time. Depending upon the page width, I want to wrap columns in multiple lines. For example, if the page width is 8", i want to fit only first 'n' columns in first line and rest columns can be displayed in second line (or more lines if required). For this I need to calculate how much data can fit in a 8" wide line. Similarly, I want to calculate the height of data that can fit into the given height of page. To summarize, how can I calculate how much data can fit into the given page size in inches. Note: The calculation should also consider the font as it is decided at run time.

    Read the article

  • Uitableview not able to hold data

    - by pankaj
    Hi i have a uitableview, i am displaying some data of about 200 rows in it. Data will be displayed in several sections which will be determined at run time. I am able to get sections but i am not able to display data for a particular section in correct order. I have data in the form of dictionaries in an array. My Code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { TeraGoAppDelegate *appDel = (TeraGoAppDelegate *)[[UIApplication sharedApplication] delegate]; UITableViewCell *cell = nil; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil] autorelease]; cell.textLabel.text = [(NSMutableDictionary *)[appDel.arrEqp objectAtIndex:countEqpIndex] objectForKey:@"EQP_NAME"]; cell.textLabel.font = [UIFont fontWithName:@"Arial" size:14]; if(![[(NSMutableDictionary *)[appDel.arrEqp objectAtIndex:indexPath.row] objectForKey:@"select"] isEqualToString:@"0"]) { cell.accessoryType = UITableViewCellAccessoryCheckmark; } else cell.accessoryType = UITableViewCellAccessoryNone; } // Set up the cell... return cell; } I am trying to use indexPath.row but its values initialises from 0 in every section I can not get data from array in this case as i dont have index of array to get data. How will i get the index of array whose values i need to display????

    Read the article

  • Making A Dynaically Created Excel Report Downloadable

    - by Nick LaMarca
    I have 2 blocks of code, if someone could help me put them together I would get the functionality I am looking for. The first block of code downloads a gridview to excel using the download dialog I am looking for: Public Overloads Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) ' Verifies that the control is rendered End Sub Private Sub ExportToExcel(ByVal filename As String, ByVal gv As GridView, ByVal numOfCol As Integer) Response.Clear() Response.Buffer = True Response.AddHeader("content-disposition", String.Format("attachment; filename={0}", filename)) Response.Charset = "" Response.ContentType = "application/vnd.ms-excel" Dim sw As New StringWriter() Dim hw As New HtmlTextWriter(sw) gv.AllowPaging = False gv.DataBind() 'Change the Header Row back to white color gv.HeaderRow.Style.Add("background-color", "#FFFFFF") For i As Integer = 0 To numOfCol - 1 gv.HeaderRow.Cells(i).Style.Add("background-color", "blue") gv.HeaderRow.Cells(i).Style.Add("color", "#FFFFFF") Next For i As Integer = 0 To gv.Rows.Count - 1 Dim row As GridViewRow = gv.Rows(i) 'Change Color back to white row.BackColor = System.Drawing.Color.White For j As Integer = 0 To numOfCol - 1 row.Cells(j).Style.Add("text-align", "center") Next 'Apply text style to each Row row.Attributes.Add("class", "textmode") 'Apply style to Individual Cells of Alternating Row If i Mod 2 <> 0 Then For j As Integer = 0 To numOfCol - 1 row.Cells(j).Style.Add("background-color", "#CCFFFF") row.Cells(j).Style.Add("text-align", "center") '#C2D69B 'row.Cells(j).Style.Add("font-size", "12pt") Next End If Next gv.RenderControl(hw) 'style to format numbers to string Dim style As String = "<style> .textmode { mso-number-format:\@; } </style>" Response.Write(style) Response.Output.Write(sw.ToString()) Response.Flush() Response.End() End Sub The second block of code is a sample report I am wish to be downloaded. So instead of downloading a gridview I want this function to accept a worksheet object.

    Read the article

  • Cancelling BackgroundWorker While Running

    - by Nevets
    I have an application in which I launch a window that displays byte data coming in from a 3rd party tool. I have included .CancelAsync() and .CancellationPending into my code (see below) but I have another issue that I am running into. private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e) { Thread popupwindow = new Thread(() => test()); popupwindow.Start(); // start test script if(backgroundWorker.CancellationPending == true) { e.Cancel = true; } } private voide window_FormClosing(object sender, FormClosingEventArgs e) { try { this.backgroundWorker.CancelAsync(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } } Upon cancelling the test I get an `InvalidOperationException occurred" error from my rich text box in my pop-up window. It states that "Invoke or BeginInvoke" cannot be called on a control until the window handle has been created". I am not entirely sure what that means and would appreciate your help. LogWindow code for Rich Text Box: public void LogWindowText(LogMsgType msgtype, string msgIn) { rtbSerialNumberValue.Invoke(new EventHandler(delegate { rtbWindow.SelectedText = string.Empty; rtbWindow.SelectionFont = new Font(rtbWindow.SelectionFont, FontStyle.Bold); rtbWindow.SelectionColor = LogMsgTypeColor[(int)msgtype]; rtbWindow.AppendText(msgIn); rtbWindow.ScrollToCaret(); })); }

    Read the article

  • Margin-Top push outer div down

    - by Daniel Hertz
    Hello, I have a header div as the first element in my wrapper div, but when I add a top margin to a h1 inside the header div it pushes the entire header div down. I realize this happens whenever I apply a top margin to the first visible element on a page. Here is a sample of the css. Thanks! div#header{ width: 100%; background-color: #000; position: relative; } div#header h1{ text-align: center; width: 375px; height: 50px; margin: 0 auto; font-size: 220%; text-indent: -5000px; background: url('../../images/name_logo.png') no-repeat; } html part <div id="header"> <h1><a href="/home.php">Title</a></h1> <ul id="navbar">

    Read the article

  • Form:has selector does not work on IE

    - by Joel
    Hey, I am trying to use "form:has" selector which works on Chrome but not on IE. http://jsbin.com/uvumu/2 Does anyone have any idea why it is not working on IE? (when pushing the Post button there should be an alert box) Edited: Here is the code: JS: $(document).ready(function() { $(".comment-link").live('click',function() { return false; }); $("#morefeeds-link").click(function () { return false; }); // Form submittion - doesnt work $("form:has(.commentBtn)").live('submit',function () { alert("a"); return false; }); return false; });? HTML <form> <a href="#" class="comment-link" style="font-size:12px;">Comment</a> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="middle"> <input type="hidden" name="commentkey" value="1"> <input type="text" name="commenttext" class="commentfocus" value="Express your opinion"> </td> <td valign="middle"><input type="submit" class="commentBtn" value="Post"></td> </tr> </table> </form>

    Read the article

  • How to import properties of an external API into Script#

    - by AndrewDotHay
    I'm using Script# inside Visual Studio 2010 to import the API for the HTML5 Canvas element. Its working great for things like FillRect(), MoveTo(), LineTo() and so on. I've declared the following interface and then I can code against it in C#. Then, Script# converts it to JavaScript nicely. public interface CanvasContext { void FillRect(int x, int y, int width, int height); void BeginPath(); void MoveTo(int x, int y); void LineTo(int x, int y); void Stroke(); void FillText(string text, int x, int y); } I want to include the StrokeStyle property that takes a simple string. The following interface definition produces a prefix in the JavaScript, which causes it to fail. string StrokeStyle { get; set; } string Font { get; set; } The previous property will create this JavaScript: ctx.set_strokeStyle('#FF0'); How can I get Script# to generate the simple assignment properties of the canvas context without the get_/set_ prefix?

    Read the article

  • how to get a text box with the value selected in select box

    - by udaya
    hi This is my view page here i have a select box <tr> <td>Chidren</td> <td>:</td> <td><select style="font-family: verdana; min-width: 52px;" id="ddlChildren" name="ddlChildren" class="required" onChange="return Check_Adult('dd1Age')" > <option value="">children</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option></select> </td> </tr> with the value from select box if the value is one then i need to create a text box if the value is two then i need to create two ,,, and respectively In my Check_Adult javascript function ,,I did this function Check_Adult() { var Child= document.getElementById('ddlChildren').value; if( Child==1) { <? echo '<input type="text" name="child" id="child">' ?> } } But the text box is not created how to create it?

    Read the article

  • How can I prevent the scaling of a UIWebview's content after reorientation?

    - by frankhermes
    I'm building an iOS 5/6 app that has a UIWebView. It loads some HTML that I have embedded in my app. Now when I rotate my device, the WebView changes its size (as I want it to fill the entire width of the screen). And then it gets weird: some content gets scaled up and some content doesn't get scaled up. See this image with some example text in it: As you can see, the header (H6) stays the same, while the paragraph gets scaled up. Does anybody have an idea how to prevent this? I want the html to look the same in landscape as it does in portrait mode. I've tried setting the viewport scaling to 1: <meta name="viewport" content="initial-scale=1.0,max-scale=1.0"> but that doesn't help. The body's font-size style is set to 14px, but changing that to 14pt or a percentage also made no difference. Setting the width of the body to 100% also didn't help. Strangely, removing the line break (<br/>) that's in the text fixes it but I need line breaks to be in there so that's no solution. The only thing that does work is reloading the UIWebView's content after an orientation change, but that doesn't prevent it from looking wrong during rotation, and it resets any scrolling that the user may have done. Any ideas?

    Read the article

  • Search box with images strange issue in ie

    - by mebots
    Have the following searchbox image: With the following code and css: #searchcontainer { margin: 40px 0 0 0; } .search { float: right; margin: 0; padding: 0; height: 21px; width: 310px; } .search input, .search button { margin: 0; padding: 0; font-size: 0.9em; color: #A7A9AC; border: 0; outline: none; } .search input.box { margin: 0; padding: 2px 5px 0 5px; width:230px; height: 19px; background: #FFF url(images/search.gif) no-repeat top left; } .search input.btn { margin: 0 0 0 -5px; padding: 0; width:70px; height: 21px; cursor:pointer; cursor: hand; /* cross browser */ text-indent: -9999px; background: #FFF url(images/search.gif) no-repeat top right; } <div id="searchcontainer"> <form id="searchform" class="search" method="post" action="#"> <input name="box" type="text" value="zoek..." class="box" /> <input name="btn" type="button" class="btn" /> </form> </div> In firefox it looks ok, but in ie and chrome the button "Zoek" goes down a bit, see image In my opinion the css is ok. but can't find where it goes wrong.

    Read the article

  • style ul with width to accommodate items

    - by Tallmaris
    Sorry I could not find a similar answer on SO. I have the following markup (generated by jquery ui autocomplete but this is not the issue here) <ul style="z-index: 1; display: block; border: thin solid red; width: 200px;"> <li> <a> <div style="font-size: 0.85em;"> <span style="float: right; padding-left: 10px; color: gray;"> United Kingdom </span> <span style="">text text text text text</span> </div> </a> </li> </ul> As you can see in this fiddle: http://jsfiddle.net/fVr8P/2/ the text wraps because the width is limited and the country span is "floating". What I would like would be for the width to enlarge to accommodate the full length, but if I put width: auto; it will expand to 100%. Background The ul is of course coming from jquery ui autocomplete. I am styling the results a bit using the autocomplete.html extension. Problem is that everything is working ok in firefox an chrome because the autocomplete is set to the correct width on creation. in IE this does not happen (width is too small) so the text wraps. I am hping to come to a simple css only solution, without fiddling around in jQuery.

    Read the article

  • Overriding CSS style 'display:none' in javascript

    - by jsarma
    I'm trying to add a checkbox toggle that hides and shows list elements by changing their style display attribute from "none" to "inline", but it's not working. I'm setting the attribute's style to "display:none" in the CSS file. Then I set it to "display:inline" in javascript when someone checks a box. The javascript is successfully changing the element's property to inline, but for some reason the element remains invisible. If I do the opposite, by setting the display to inline in the CSS and overriding it to none in the javascript, it works fine. I don't see why this would work one way but not the other. I'm using chrome. Here is the code. Any feedback is appreciated. CSS file: #tabmenu li[status='disabled'] a, a.active, #disabled { color: #777777; background: #DDDDDD; font: normal 1em Arial; border: 1px solid black; border-radius: inherit; padding: 0px 5px 0px 5px; margin: 0px; text-decoration: none; cursor:hand; display:none; } HTML: <ul id="tabmenu"> <li name='tab' id='tab1' selected='no' status='disabled'></li> </ul> JAVASCRIPT (from command line, or onchange of a checkbox) tab = document.getElementById('tab1'); tab.style.display = 'inline';

    Read the article

  • AS3 TextField is blank, doesn't accept any of my settings??

    - by Andy Melichar
    Having a strange issue with assigning a TextField to a movie clip. nameFormat = new TextFormat(); nameFormat.size = 14; nameFormat.color = "0x000000"; nameFormat.border = true; nameFormat.font = "Arial"; charName = new TextField(); charName.defaultTextFormat = nameFormat; charName.text = value.charname; charName.x = 92.5; charName.y = 6.5; charName.width = 205; charName.height = 21; thechars[value.charid].addChild(charName); If I trace charName.text it traces correctly, but when the containing movieclip is displayed, it is always blank and none of my settings (borders, background color, etc..) show up. I'm placing several of these movieclips into another movieclip, which is then added to a scroller as such: scrollContent.addChild(thechars[newvalue.charid]); theScroller.source = scrollContent; The strange thing is that I am using the exact same method to drop a button into each of the 'thechars' and it shows up and works fine. AND... if I hover my mouse over the spot where the textField should be, I can see my mouse change from a pointer to a text cursor, so the textFields are showing up, they are just blank? Help?

    Read the article

  • Length of a string in pixels

    - by Rose
    Guys, I'm populating a dropDownList with arrayCollection of strings. I want the width of the drop down list control to match with the size (in pixels) of the longest string in the array collection. The problem I'm facing is: the font width of the strings in the collection are different e.g. 'W' looks wider than 'l'. So I estimated the width of a character to be 8 pixels but that's not pretty neat. If a string that has many 'W' and 'M' is encountered the estimation is wrong. So I want precise pixel width of strings. How can i get the exact length of a string in pixels?? My solution that estimates all character to be 8 pixels wide is given below: public function populateDropDownList():void{ var array:Array = new Array("o","two","three four five six seven eight wwww"); var sampleArrayCollection:ArrayCollection = new ArrayCollection(array); var customDropDownList:DropDownList = new DropDownList(); customDropDownList.dataProvider=sampleArrayCollection; customDropDownList.prompt="Select ..."; customDropDownList.labelField="Answer Options:"; //calculating the max width var componentWidth=10; //default for each(var answerText in array){ Alert.show("Txt size: "+ answerText.length + " pixels: " + answerText.length*9); if(answerText.length * 8 > componentWidth){ componentWidth=answerText.length * 8; } } customDropDownList.width=componentWidth; answers.addChild(customDropDownList); } Any idea or solution is highly valued. Thanks

    Read the article

  • The page at [ Page URL ] could not be reached. (Urgent)

    - by Danial Sabagh
    I want to add the like button on my website, but it does not work because whenever I click on Like button it says: The page at could not be reached. You can also check the url to see the error: My Facebook page Here is what I did to use the code: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#"> <head> <meta property="og:title" content="ALEXA BEAUTY" /> <meta property="og:type" content="company" /> <meta property="og:url" content="http://alexasalon.co.uk/" /> <meta property="og:image" content="http://alexasalon.co.uk/images/logo.png" /> <meta property="og:site_name" content="ALEXA BEAUTY" /> <meta property="fb:admins" content="100002556535323" /> </head> <body> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=220687968005095"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div> <fb:like href="http://www.facebook.com/pages/Alexa-Beauty/205401152839187" send="true" width="450" show_faces="false" font="lucida grande"></fb:like> </div> Is the code wrong? Is the page URL correct? I checked the website on Object Debugger and seems there is no error, check link please. I really do not know what is wrong? Does anyone know?!

    Read the article

  • CSS - background-size: cover; not working in Firefox

    - by Jayant Bhawal
    body{ background-image: url("./content/site_data/bg.jpg"); background-size: cover; background-repeat: no-repeat; font-family: 'Lobster', cursive; } Check: http://demo.jayantbhawal.in on firefox browsers, NOT in widescreen mode. The code works on Chrome(Android + PC) and even the stock Android browser, but NOT Firefox(Android + PC). Is there any good alternative to it? Why is it not working anyways? Googled this issue a lot of times, but no one else seems to have this problem. Is it just me? In any case, how do I fix it? There are quite some questions on SO about it too, but none of them provide a legitimate solution, so can someone just tell me if they have background-size: cover; issues on firefox too? So basically tell me 3 things: 1. Why is it happening? 2. What is a good alternative to it? 3. Is this happening to you too? On Firefox browsers of course. Chrome Version 35.0.1916.114 m Firefox Version 29.0.1 Note: I may already be trying to fix it so at times you may see a totally weird page. Wait a bit and reload.

    Read the article

  • Why does this CSS button mess with <a> tags?

    - by Ian McCullough
    Here is my CSS button { border: 0 none; cursor: pointer; padding: 0 15px 0 0; text-align: center; height: 30px; line-height: 30px; width: auto; } button a { color:white; text-decoration:none; } button.rounded { background: transparent url(/images/button/btn_right.png) no-repeat scroll right top; clear: left; font-size: 0.8em; } button span { display: block; padding: 0 0 0 15px; position: relative; white-space: nowrap; height: 30px; line-height: 30px; } button.rounded span { background: transparent url(/images/button/btn_left.png) no-repeat scroll left top; color: #FFFFFF; } button.rounded:hover { background-position: 100% -30px; } button.rounded:hover span { background-position: 0% -30px; } button::-moz-focus-inner { border: none; } Here is the code for my "button" with a link in it. <button class="rounded"><span><a href="profile.php">Profile</a></span></button> The issue is it does not link to the href when i click on it. Anyone know why?

    Read the article

  • Background-image is not displaying in Firefox

    - by goa
    Strange thing happens. Background-image is not displaying in Firefox under some versions of WindowsXP and Windows Vista, but displays in Firefox under Mac OSX. It also displays in IE. This is CSS: .cherry_banner { background: url("library/media/images/cherry_banner_top.png") no-repeat; width: 276px; display:block; min-height:100px; padding-top: 13px; color: #fdfdfd; margin-bottom:20px; } .cherry_banner a { color: #fdfdfd; } .cherry_banner a:hover { text-decoration:underline; } .cherry_banner li { list-style-type:none; } .cherry_banner h2 { font-size: 18px; margin-bottom: 10px; } .chb_text1 { background: url("library/media/images/cherry_banner_pixel.png") repeat-y; } .chb_text2 { background: url("library/media/images/cherry_banner_bottom.gif") bottom no-repeat; padding: 4px 14px 24px 25px; } And this is html: <div id="linkcat-8" class="cherry_banner tpt"><div class="chb_text1"><div class="chb_text2"> <h2>??? ?????????</h2> <ul class='xoxo blogroll'> <li><a href="http://inveda.ru/jyotish/naksatra-calendar/">???????? ?????????? ?????????????? ????????? ????????????? ??? ?? 2010?.</a></li> </ul> </div></div></div> You can see on http://www.inveda.ru - right column - red banner.

    Read the article

  • Zoom in Java Swing application

    - by Shirky
    Hi there, I am looking for ways to zoom in a Java Swing application. That means that I would like to resize all components in a given JPanel by a given factor as if I would take an screenshot of the UI and just applied an "Image scale" operation. The font size as well as the size of checkboxes, textboxes, cursors etc. has to be adjusted. It is possible to scale a component by applying transforms to a graphics object: protected Graphics getComponentGraphics(Graphics g) { Graphics2D g2d=(Graphics2D)g; g2d.scale(2, 2); return super.getComponentGraphics(g2d); } That works as long as you don't care about self-updating components. If you have a textbox in your application this approach ceases to work since the textbox updates itself every second to show the (blinking) cursor. And since it doesn't use the modified graphics object this time the component appears at the old location. Is there a possibility to change a components graphics object permanently? There is also a problem with the mouse click event handlers. The other possibility would be to resize all child components of the JPanel (setPreferredSize) to a new size. That doesn't work for checkboxes since the displayed picture of the checkbox doesn't change its size. I also thought of programming my own layout manager but I don't think that this will work since layout managers only change the position (and size) of objects but are not able to zoom into checkboxes (see previous paragraph). Or am I wrong with this hypothesis? Do you have any ideas how one could achieve a zoomable Swing GUI without programming custom components? I looked for rotatable user interfaces because the problem seems familiar but I also didn't find any satisfying solution to this problem. Thanks for your help, Chris

    Read the article

  • Unordered list appears higher than div

    - by LordArmadillo
    I am trying to create a simple page, which I normally can without any trouble. However, the unordered list appears higher up the page than the div. I do know a solution for this, however I cannot remember it. The page goes like this: <style> ul.menu { list-style-type: none; margin:150; margin-bottom:30px; padding:0; display: block; width: 708px; margin-left: auto; margin-right: auto; } li.menu { float:left; display: block; width: 118px; } a.menu:link,a.menu:visited { color:black; display:block; border:1px solid black; background-color:#FFFF00; width:118px; text-align:center; text-decoration:none; font-family:"Courier New", Courier, monospace } a.menu:hover { background-color:#FFBB11; } </style> <div id="head"> My images here & such</div> <ul class="menu"> <li class="menu"> <a class="menu">Main</a> </li> </ul> Normally I welcome suggestions to change my code, but I have a deadline today! So, quick & simple help would be appreciated! Thanks! LordArmadillo

    Read the article

  • singledispatch in class, how to dispatch self type

    - by yanxinyou
    Using python3.4. Here I want use singledispatch to dispatch different type in __mul__ method . The code like this : class Vector(object): ## some code not paste @functools.singledispatch def __mul__(self, other): raise NotImplementedError("can't mul these type") @__mul__.register(int) @__mul__.register(object) # Becasue can't use Vector , I have to use object def _(self, other): result = Vector(len(self)) # start with vector of zeros for j in range(len(self)): result[j] = self[j]*other return result @__mul__.register(Vector) # how can I use the self't type @__mul__.register(object) # def _(self, other): pass # need impl As you can see the code , I want support Vector*Vertor , This has Name error Traceback (most recent call last): File "p_algorithms\vector.py", line 6, in <module> class Vector(object): File "p_algorithms\vector.py", line 84, in Vector @__mul__.register(Vector) # how can I use the self't type NameError: name 'Vector' is not defined The question may be How Can I use class Name a Type in the class's method ? I know c++ have font class statement . How python solve my problem ? And it is strange to see result = Vector(len(self)) where the Vector can be used in method body .

    Read the article

  • How to get attributes from both relative and absolute positioning

    - by user3677286
    I have a footer that i want to attach to the bottom of the page using bottom:0px. However, I also want to center it by using margin-left:auto; and margin-right:auto;. Effectively, this will stick the footer to the bottom of the page while keeping it centered vertically. Unfortunately, these cannot be used together as bottom:0px requires position:relative while margin-left:auto and margin-right:auto require position:absolute. How can I get both of these attributes onto the same div without creating a container? If not possible, what is a clean way of getting both these attributes? ALSO: I do NOT want to have a fixed position. footer.css: .footer { /*background-color:blue;*/ min-height:10px; width:940px; margin-top:5px; margin-left:auto; /* WILL ONLY WORK IF POSITION IS RELATIVE */ margin-right:auto; padding:5px; display:block; border-top: 3px solid #CCCCCC; text-align: center; font-family:arial; color:gray; position: relative; bottom:0px; /* WILL ONLY WORK IF POSITION IS ABSOLUTE */ } Thanks.

    Read the article

< Previous Page | 167 168 169 170 171 172 173 174 175 176 177 178  | Next Page >