Search Results

Search found 1732 results on 70 pages for 'scrolling'.

Page 64/70 | < Previous Page | 60 61 62 63 64 65 66 67 68 69 70  | Next Page >

  • Carousel not working in IE7/8

    - by user515990
    I am working with jquery.carouFredSel-4.0.3-packed.js for the carousal and it works good with IE9 and mozilla,but in IE7/8, it says "LOG: carouFredSel: Not enough items: not scrolling " whenever i am seeing it is not the case. The code i am using is <div class="carousel-wrapper"> <div class="mask"> <a class="arrow left off"><-</a> <a class="arrow left on" href="javascript:void(0);"><-</a> <ul> <dsp:droplet name="ForEach"> <dsp:param name="array" value="${listRecommended}"/> <dsp:oparam name="empty">no recommended apps</dsp:oparam> <dsp:oparam name="output"> <li> <a href="javascript:void(0);"><img src="${resourcePath}/images/apps/carousel-image1.jpg" alt="bakery story"/></a> <a href="javascript:void(0);"><dsp:valueof param="element.displayName"/></a><br/> <dsp:getvalueof var="averageRating" param="element.averageRating"/> <dsp:getvalueof var="rating" param="count"/> <div class="rating"> <div class="medium"> <dsp:droplet name="For"> <dsp:param name="howMany" value="${averageRating}"/> <dsp:oparam name="output"> <input checked="checked" class="star {split:1}" disabled="disabled" name="product-similar-'${rating}'" type="radio"> </dsp:oparam> </dsp:droplet> </div> </div> </li> </dsp:oparam> </dsp:droplet> </ul> </div> <a class="arrow right off">-></a> <a class="arrow right on" href="javascript:void(0);">-></a> </div> and javascript library is jquery.carouFredSel-4.0.3-packed.js. Please let me know if someone has faced similar problem. thanks in advance Hemish

    Read the article

  • How do I prevent the concurrent execution of a javascript function?

    - by RyanV
    I am making a ticker similar to the "From the AP" one at The Huffington Post, using jQuery. The ticker rotates through a ul, either by user command (clicking an arrow) or by an auto-scroll. Each list-item is display:none by default. It is revealed by the addition of a "showHeadline" class which is display:list-item. HTML for the UL Looks like this: <ul class="news" id="news"> <li class="tickerTitle showHeadline">Test Entry</li> <li class="tickerTitle">Test Entry2</li> <li class="tickerTitle">Test Entry3</li> </ul> When the user clicks the right arrow, or the auto-scroll setTimeout goes off, it runs a tickForward() function: function tickForward(){ var $active = $('#news li.showHeadline'); var $next = $active.next(); if($next.length==0) $next = $('#news li:first'); $active.stop(true, true); $active.fadeOut('slow', function() {$active.removeClass('showHeadline');}); setTimeout(function(){$next.fadeIn('slow', function(){$next.addClass('showHeadline');})}, 1000); if(isPaused == true){ } else{ startScroll() } }; This is heavily inspired by Jon Raasch's A Simple jQuery Slideshow. Basically, find what's visible, what should be visible next, make the visible thing fade and remove the class that marks it as visible, then fade in the next thing and add the class that makes it visible. Now, everything is hunky-dory if the auto-scroll is running, kicking off tickForward() once every three seconds. But if the user clicks the arrow button repeatedly, it creates two negative conditions: Rather than advance quickly through the list for just the number of clicks made, it continues scrolling at a faster-than-normal rate indefinitely. It can produce a situation where two (or more) list items are given the .showHeadline class, so there's overlap on the list. I can see these happening (especially #2) because the tickForward() function can run concurrently with itself, producing different sets of $active and $next. So I think my question is: What would be the best way to prevent concurrent execution of the tickForward() method? Some things I have tried or considered: Setting a Flag: When tickForward() runs, it sets an isRunning flag to true, and sets it back to false right before it ends. The logic for the event handler is set to only call tickForward() if isRunning is false. I tried a simple implementation of this, and isRunning never appeared to be changed. The jQuery queue(): I think it would be useful to queue up the tickForward() commands, so if you clicked it five times quickly, it would still run as commanded but wouldn't run concurrently. However, in my cursory reading on the subject, it appears that a queue has to be attached to the object its queue applies to, and since my tickForward() method affects multiple lis, I don't know where I'd attach it.

    Read the article

  • SilverLight 3 Beginner question: Scroll with mousewheel and zoom image with panning

    - by JP Hellemons
    Hello, I would like to make a small silverlight app which displays one fairly large image which can be zoomed in by scrolling the mouse and then panned with the mouse. it's similar to the function in google maps and i do not want to use deepzoom. here is what i have at the moment. please keep in mind that this is my first silverlight app: this app is just for me to see it's a good way to build in a website. so it's a demo app and therefor has bad variable names. the initial image is 1800px width. private void sc_MouseWheel(object sender, MouseWheelEventArgs e) { var st = (ScaleTransform)plaatje.RenderTransform; double zoom = e.Delta > 0 ? .1 : -.1; st.ScaleX += zoom; st.ScaleY += zoom; } this works, but could use some smoothing and it's positioned top left and not centered. the panning is like this: found it @ http://stackoverflow.com/questions/741956/wpf-pan-zoom-image and converted it to this below to work in silverlight Point start; Point origin; bool captured = false; private void plaatje_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { plaatje.CaptureMouse(); captured = true; var tt = (TranslateTransform)((TransformGroup)plaatje.RenderTransform) .Children.First(tr => tr is TranslateTransform); start = e.GetPosition(canvasje); origin = new Point(tt.X, tt.Y); } private void plaatje_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { plaatje.ReleaseMouseCapture(); captured = false; } private void plaatje_MouseMove(object sender, MouseEventArgs e) { if (!captured) return; var tt = (TranslateTransform)((TransformGroup)plaatje.RenderTransform).Children.First(tr => tr is TranslateTransform); double xVerschuiving = start.X - e.GetPosition(canvasje).X; double yVerschuiving = start.Y - e.GetPosition(canvasje).Y; tt.X = origin.X - xVerschuiving; tt.Y = origin.Y - yVerschuiving; } so the scaling isn't smooth and the panning isn't working, because when i click it, the image disappears. thanks in advanced!

    Read the article

  • UITableViewCell with selectable/copyable text that also detects URLs on the iPhone

    - by Jasarien
    Hi guys, I have a problem. Part of my app requires text to be shown in a table. The text needs to be selectable/copyable (but not editable) and any URLs within the text need to be highlighted and and when tapped allow me to take that URL and open my embedded browser. I have seen a couple of solutions that solve one of either of these problems, but not both. Solution 1: Icon Factory's IFTweetLabel The first solution I tried was to use the IFTweetLabel class made possible by Icon Factory and used in Twitterrific. While this solution allows for links (or anything you can find with a regex) to be detected to be handled on a case by case basis, it doesn't allow for selecting and copying. There is also an issue where if a URL is long enough to be wrapped, the button that the class overlays above the URL to make it interactive cannot wrap and draws off screen, looking very odd. Solution 2: Use IFTweetLabel and handle copy manually The second thing I tried was to keep IFTweetLabel in place to handle the links, but to implement the copying using a long-tap gesture, like how the SMS app handles it. This was just about working, but it doesn't allow for arbitrary selection of text, the whole text is copied, or none is copied at all... Pretty black and white. Solution 3: UITextView My third attempt was to add a UITextView as a subview of the table cell. The only thing that this doesn't solve is the fact that detected URLs cannot be handled by me. The text view uses UIApplication's openURL: method which quits my app and launched Safari. Also, as the table view can get quite large, the number of UITextViews added as subviews cause a noticeable performance drag on scrolling throughout the table, especially on iPhone 3G era devices (because of the creation, layout, compositing whenever a cell is scrolled on screen, etc). So my question to all you knowledgeable folk out there is: What can I do? Would a UIWebView be the best option? Aside from a performance drag, I think a webview would solve all the above issues, and if I remember correctly, back in the 2.0 days, the Apple documentation actually recommended web views where text formatting / hyperlinks were required. Can anyone think of a way to achieve this without a performance drag? Many thanks in advance to everyone who can help.

    Read the article

  • <plugin> not a function

    - by bah
    Hi, I've been trying to solve this mystery almost 2 hours, this is giving me a headache. I tried 2 plug-ins already and I'm always getting "* is not a function". My code is exactly like examples so I don't know why it's not working. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>asd</title> <script type="text/javascript" src="jquery.js"></script> <script type='text/javascript' src='serial/jquery.scrollTo'></script> <script type='text/javascript' src='serial/jquery.serialScroll'></script> <script type="text/javascript"> $(document).ready(function(){ $('#slider').serialScroll({ items:'li', offset:-230, //when scrolling to photo, stop 230 before reaching it (from the left) start:1, //as we are centering it, start at the 2nd duration:1200, force:true, stop:true, lock:false, cycle:false, //don't pull back once you reach the end easing:'easeOutQuart', //use this easing equation for a funny effect jump: true //click on the images to scroll to them }); }); </script> </head> <body> <div id="slider"> <ul> <li><img width="500" height="500" src="dummy/dummy.jpg" alt="Css Template Preview" /></li> <li><img width="500" height="500" src="dummy/dummy1.jpg" alt="Css Template Preview" /></li> <li><img width="500" height="500" src="dummy/dummy2.jpg" alt="Css Template Preview" /></li> <li><img width="500" height="500" src="dummy/dummy3.jpg" alt="Css Template Preview" /></li> </ul> </div> </body> </html> I must be missing something essential there because I see nothing what's wrong. I'm using jQuery 1.4.2. and there are plug-ins I've tried - Easy Slider, jQuery serial scroll

    Read the article

  • Redundant margins when adding ImageView to ScrollView in Android.

    - by Shmuel Meymann
    Hi.. I have been trying to use a ScrollView on a single ImageView with a JPG (~770 x 1024) over an AVD that's 600x800. My main.xml is: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ScrollView android:id="@+id/scroller" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout> Now, I add a single ImageView with setContentView(R.layout.main); ScrollView sv = (ScrollView)findViewById( R.id.scroller ); ImageView iv = new ImageView(this); iv.setImageDrawable( new BitmapDrawable( "/sdcard/770x1024.jpg" ) ); // same happens with ScaleDrawable. iv.setScaleType( ScaleType.CENTER_INSIDE ); sv.addView( sv ); // and it does not go any better if I use Linear Layout between the ScrollView and the ImageView. The result is The image was displayed in a middle of a ScrollView, wrapped with background area on top and bottom as following: ##### ##### image . . . ##### ##### Where ##### stands for background area I tried to set the background of the ImageView red, and it verified that the blank margins were ImageView background. iv.setBackgroundColor( color.Red ); Where I would expect the image to take no more than its size (scaled to the AVD size) and I expect the ScrollView to let me scroll over the remainder (if any). For some reason, I see that the drawable size is 600x1024. Moreover I tried to add a LinearLayout with a dummy text view such as the linear layout is a parent to the ImageView and the TextView, and the ScrollView is a parent to the LinearLayout. LinearLayout dummy = new LinearLayout( this ); dummy.addView(iv); TextView someTextView = new TextView( this ); someTextView.setLayoutParams(new LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT )); dummy.addView( someTextView ); sv.addView( dummy ); The result was very peculiar: The entire layout was set into the width of a text-less text view (19). It is important for me to avoid stretching the image. What is the recommended way to implement a display of a page that can be potentially scrolled? Do I have to do it manually with a plain layout and scrolling upon OnMove events? Thanks Shmuel

    Read the article

  • Swing: Scroll to bottom of JScrollPane, conditionally on current viewport location

    - by I82Much
    Hi all, I am attempting to mimic the functionality of Adium and most other chat clients I've seen, wherein the scrollbars advance to the bottom when new messages come in, but only if you're already there. In other words, if you've scrolled a few lines up and are reading, when a new message comes in it won't jump your position to the bottom of the screen; that would be annoying. But if you're scrolled to the bottom, the program rightly assumes that you want to see the most recent messages at all times, and so auto-scrolls accordingly. I have had a bear of a time trying to mimic this; the platform seems to fight this behavior at all costs. The best I can do is as follows: In constructor: JTextArea chatArea = new JTextArea(); JScrollPane chatAreaScrollPane = new JScrollPane(chatArea); // We will manually handle advancing chat window DefaultCaret caret = (DefaultCaret) chatArea.getCaret(); caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE); In method that handles new text coming in: boolean atBottom = isViewAtBottom(); // Append the text using styles etc to the chatArea if (atBottom) { scrollViewportToBottom(); } public boolean isAtBottom() { // Is the last line of text the last line of text visible? Adjustable sb = chatAreaScrollPane.getVerticalScrollBar(); int val = sb.getValue(); int lowest = val + sb.getVisibleAmount(); int maxVal = sb.getMaximum(); boolean atBottom = maxVal == lowest; return atBottom; } private void scrollToBottom() { chatArea.setCaretPosition(chatArea.getDocument().getLength()); } Now, this works, but it's janky and not ideal for two reasons. By setting the caret position, whatever selection the user may have in the chat area is erased. I can imagine this would be very irritating if he's attempting to copy/paste. Since the advancement of the scroll pane occurs after the text is inserted, there is a split second where the scrollbar is in the wrong position, and then it visually jumps towards the end. This is not ideal. Before you ask, yes I've read this blog post on Text Area Scrolling, but the default scroll to bottom behavior is not what I want. Other related (but to my mind, not completely helpful in this regard) questions: Setting scroll bar on a jscrollpane Making a JScrollPane automatically scroll all the way down. Any help in this regard would be very much appreciated.

    Read the article

  • Swing: Scroll to bottom of JScrollPane, conditional on current viewport location

    - by I82Much
    Hi all, I am attempting to mimic the functionality of Adium and most other chat clients I've seen, wherein the scrollbars advance to the bottom when new messages come in, but only if you're already there. In other words, if you've scrolled a few lines up and are reading, when a new message comes in it won't jump your position to the bottom of the screen; that would be annoying. But if you're scrolled to the bottom, the program rightly assumes that you want to see the most recent messages at all times, and so auto-scrolls accordingly. I have had a bear of a time trying to mimic this; the platform seems to fight this behavior at all costs. The best I can do is as follows: In constructor: JTextArea chatArea = new JTextArea(); JScrollPane chatAreaScrollPane = new JScrollPane(chatArea); // We will manually handle advancing chat window DefaultCaret caret = (DefaultCaret) chatArea.getCaret(); caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE); In method that handles new text coming in: boolean atBottom = isViewAtBottom(); // Append the text using styles etc to the chatArea if (atBottom) { scrollViewportToBottom(); } public boolean isAtBottom() { // Is the last line of text the last line of text visible? Adjustable sb = chatAreaScrollPane.getVerticalScrollBar(); int val = sb.getValue(); int lowest = val + sb.getVisibleAmount(); int maxVal = sb.getMaximum(); boolean atBottom = maxVal == lowest; return atBottom; } private void scrollToBottom() { chatArea.setCaretPosition(chatArea.getDocument().getLength()); } Now, this works, but it's janky and not ideal for two reasons. By setting the caret position, whatever selection the user may have in the chat area is erased. I can imagine this would be very irritating if he's attempting to copy/paste. Since the advancement of the scroll pane occurs after the text is inserted, there is a split second where the scrollbar is in the wrong position, and then it visually jumps towards the end. This is not ideal. Before you ask, yes I've read this blog post on Text Area Scrolling, but the default scroll to bottom behavior is not what I want. Other related (but to my mind, not completely helpful in this regard) questions: Setting scroll bar on a jscrollpane Making a JScrollPane automatically scroll all the way down. Any help in this regard would be very much appreciated.

    Read the article

  • Why don't my scrollbars work properly when programmatically hiding rows in silverlight Datagrid?

    - by Luke Vilnis
    I have a Silverlight datagrid with custom code that allows for +/- buttons on the lefthand side and can display a table with a tree structure. The +/- buttons are bound to a IsExpanded property on my ViewModelRows, as I call them. The visibility of rows is bound to an IsVisible property on the ViewModelRows which is determined based on whether or not all of the parent rows are expanded. Straightforward enough. This code works fine in that if I scroll up and down the grid with PageUp/PageDown or the arrow keys, all the right rows are hidden and everything has the right structure and I can play with the +/- buttons to my hearts content. However, the vertical scroll bar on the right hand side, although it starts off the correct size and it scrolls through the rows smoothly, when I collapse rows and then re-expand them, doesn't go back to its correct size. The scrollbar can still usually be moved around to scroll through the whole collection, but because it is too big, once the bar moves to the bottom, there are still more rows to go through and it sort of jerkily shoots all the way down to the bottom or sometimes fails to scroll at all. This is pretty hard to describe so I included a screenshot with the black lines drawn on to show the difference in scrollbar length even though the two grids have the same number of rows expanded. I think this might be a bug related to the way the Datagrid does virtualization of rows. It seems to me like it isn't properly keeping track of how tall each row is supposed to be when expansion states change. Is there a way to programmatically "poke" (read hack) it to recalculate its scrollbar size on LoadingRow or something ugly like that? I'd include a code sample but there's 2 c# files and 1 xaml file so I wanted to see if anyone else has heard of this sort of issue before I try to make it reproducible in a self-contained way. Once again, scrolling with the arrow keys works fine so I'm pretty sure the underlying logic and binding is working, there's just some issue with the row height not being calculated properly. Since I'm a new user, it won't let me use image tags so here's the link to a picture of the problem: http://img210.imageshack.us/img210/8760/messedupscrollbars.png

    Read the article

  • jQuery - draggable images on iPad / iPhone - how to integrate event.preventDefault();?

    - by Tim
    Hello! I use jQuery, jQuery UI and jQuery mobile to build a web application for iPhone / iPad. Now I create images and they should be draggable, so I did this: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <title>Drag - Test</title> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.css" /> <script src="http://code.jquery.com/jquery-1.4.4.min.js"></script> <script src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js"></script> </head> <body> <div> <div style="width:500px;height:500px;border:1px solid red;"> <img src="http://upload.wikimedia.org/wikipedia/en/thumb/9/9e/JQuery_logo.svg/200px-JQuery_logo.svg.png" class="draggable" alt="jQuery logo" /> <img src="http://upload.wikimedia.org/wikipedia/en/a/ab/Apple-logo.png" class="draggable" alt="Apple Inc. logo" /> </div> </div> </body> <script type="text/javascript"> $(document).ready(function() { $(".draggable").draggable(); }); </script> </html> Here you can see the live example: http://jsbin.com/igena4/ The problem is, that the whole page want to scroll. I searched in Apple's HTML5 examples and found this to prevent the scrolling of the page, so that the image is draggable: ... onDragStart: function(event) { // stop page from panning on iPhone/iPad - we're moving a note, not the page event.preventDefault(); ... } But the problem is for me, how can I include this into my jQuery? Where do I get event? Best Regards.

    Read the article

  • Chaining animations and memory management

    - by bryan1967
    Hey Everyone, Got a question. I have a subclassed UIView that is acting as my background where I am scrolling the ground. The code is working really nice and according to the Instrumentation, I am not leaking nor is my created and still living Object allocation growing. I have discovered else where in my application that adding an animation to a UIImageView that is owned by my subclassed UIView seems to bump up my retain count and removing all animations when I am done drops it back down. My question is this, when you add an animation to a layer with a key, I am assuming that if there is already a used animation in that entry position in the backing dictionary that it is released and goes into the autorelease pool? For example: - (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag { NSString *keyValue = [theAnimation valueForKey:@"name"]; if ( [keyValue isEqual:@"step1"] && flag ) { groundImageView2.layer.position = endPos; CABasicAnimation *position = [CABasicAnimation animationWithKeyPath:@"position"]; position.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; position.toValue = [NSValue valueWithCGPoint:midEndPos]; position.duration = (kGroundSpeed/3.8); position.fillMode = kCAFillModeForwards; [position setDelegate:self]; [position setRemovedOnCompletion:NO]; [position setValue:@"step2-1" forKey:@"name"]; [groundImageView2.layer addAnimation:position forKey:@"positionAnimation"]; groundImageView1.layer.position = startPos; position = [CABasicAnimation animationWithKeyPath:@"position"]; position.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; position.toValue = [NSValue valueWithCGPoint:midStartPos]; position.duration = (kGroundSpeed/3.8); position.fillMode = kCAFillModeForwards; [position setDelegate:self]; [position setRemovedOnCompletion:NO]; [position setValue:@"step2-2" forKey:@"name"]; [groundImageView1.layer addAnimation:position forKey:@"positionAnimation"]; } else if ( [keyValue isEqual:@"step2-2"] && flag ) { groundImageView1.layer.position = midStartPos; CABasicAnimation *position = [CABasicAnimation animationWithKeyPath:@"position"]; position.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; position.toValue = [NSValue valueWithCGPoint:endPos]; position.duration = 12; position.fillMode = kCAFillModeForwards; [position setDelegate:self]; [position setRemovedOnCompletion:NO]; [position setValue:@"step1" forKey:@"name"]; [groundImageView1.layer addAnimation:position forKey:@"positionAnimation"]; } } This chains animations infinitely, and as I said one it is running the created and living object allocation doesn't change. I am assuming everytime I add an animation the one that exists in that key position is released. Just wondering I am correct. Also, I am relatively new to Core Animation. I tried to play around with re-using the animations but got a little impatient. Is it possible to reuse animations? Thanks! Bryan

    Read the article

  • MVVM Binding Orthogonal Aspects in Views e.g. Application Settings

    - by chibacity
    I have an application which I am developing using WPF\Prism\MVVM. All is going well and I have some pleasing MVVM implementations. However, in some of my views I would like to be able to bind application settings e.g. when a user reloads an application, the checkbox for auto-scrolling a grid should be checked in the state it was last time the user used the application. My view needs to bind to something that holds the "auto-scroll" setting state. I could put this on the view-model, but applications settings are orthogonal to the purpose of the view-model. The "auto-scroll" setting is controlling an aspect of the view. This setting is just an example. There will be quite a number of them and splattering my view-models with properties to represent application settings (so I can bind them) feels decidedly yucky. One view-model per view seems to be de rigeuer... What is best\usual practice here? Splatter my view-models with application settings? Have multiple view-models per view so settings can be represented in their own right? Split views so that controls can bind to an ApplicationSettingsViewModel? = too many views? Something else? Edit 1 To add a little more context, I am developing a UI with a tabbed interface. Each tab will host a single widget and there a variety of widgets. Each widget is a Prism composition of individual views. Some views are common amongst widgets e.g. a file picker view. Whilst each widget is composed of several views, as a whole, conceptually a widget has a single set of user settings e.g. last file selected, auto-scroll enabled, etc. These need to be persisted and retrieved\applied when the application starts again, and the widget views are created. My question is focused on the fact that conceptually a widget has a single set of user settings which is at right-angles to the fact that a widget consists of many views. Each view in the widget has it's own view-model (which works nicely and logically) but if I stick to a one view-model per view, I would have to splatter each view-model with user settings appropriate to it. This doesn't sound right ?!?

    Read the article

  • Why Won't My ASP.NET Hyperlink Work in IE?

    - by Giffyguy
    I'm making a very simple ad button system using ASP.NET 2.0 The advertisment is a 150x150px square that is displayed on "the r house." (Scroll down a little and you'll see the bright green "Angry Octopus" on the right side of the screen.) Now, I am not the administrator of "the r house." Instead, I am the administrator of angryoctopus.net Therefore, I don't have the ability to change the ad display code on a whim. So I gave "the r house" this snippet of code to display our ad nicely, while still allowing me to customize the back-end code on my end: <iframe src="http://www.angryoctopus.net/Content/Ad/150x150.aspx" frameborder="0" width="150" height="150" scrolling="no" style="padding: 0; margin: 0;"></iframe> You'll find this snippet in the page source to "the r house." On my side, the code looks like this: <asp:HyperLink runat="server" NavigateUrl="http://www.angryoctopus.net/" Target="_top"> <asp:Panel ID="pnlMain" runat="server" BackColor="#D1E231" style="padding: 0; margin: 0" Width="150" Height="150"> <asp:Image runat="server" ImageUrl="http://www.angryoctopus.net/Content/Ad/150x150.png" BorderStyle="None" style="padding: 0; margin: 0" /> </asp:Panel> </asp:HyperLink> ... and there's some insignificant back-end C# code for hit-counting. This looks all well and good from the code standpoint, as far as I can tell. Everything works in Firefox and Chrome. Also, everything appears to work in IE8 in all of my tests. I haven't tested IE7. But when you view "the r house" in IE(8) the hyperlink doesn't do anything, and the cursor doesn't indicate that the hyperlink is even there. Although you can see the target URL in the status bar. I've considered the fact that "the r house" uses XHTML 1.0 Strict could be causing problems, but that would probably effect Firefox and Chrome right? (My aspx pages use XHTML 1.0 Transitional) My only other theory is that some random CSS class could be applying a weird attribute to my iframe, but again I would expect that would effect Firefox and Chrome. Is this a security issue with IE? Does anyone know what part of the r house's website could be blocking the hyperlink in IE? And how can I get around this without having to hard code anything on the r house's website? Is there an alternative to iframe that would do the same job without requiring complicated scripting?

    Read the article

  • Strange behaviour when posting CGEvent to PSN

    - by Ben Packard
    If I set up a loop that posts some keyboard events to a PSN, I find that it works fine except for when first launched. The event only seems to post when i do something with the mouse manually - even just moving it slightly. Here's the details, if they help. An external application has a list box of text lines, which I am reading by posting copy commands (and checking the pasteboard). Unfortunately this is my only way to get this text. Sometimes, the application pulls focus away from the list, which I can detect. When this happens, the most reliable way to return focus is by sending a mouse event to click on a text field directly above the list, then send a 'tab' keyboard event to shift the focus onto the list. So at launch, the loop runs fine, scrolling down the list and copying the text. When focus is shifted away, its is detected fine, and the events are sent to move focus back to the list. But nothing seems to happen. The loop continues detecting that focus has changed, but the events only work once I move the mouse. Or even just use the scroll wheel. Strange. Once this has happened the first time, it works fine - each time focus moves, the PSN events switch it back without me having to do anything at all. Here's the code that runs in the loop - verified as working: //copy to pasteboard - CMD-V e3 = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)8, true); CGEventSetFlags(e3, kCGEventFlagMaskCommand); CGEventPostToPSN(&psn, e3); CFRelease(e3); e4 = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)8, false); CGEventPostToPSN(&psn, e4); CFRelease(e4); //move cursor down e1 = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)125, true); CGEventPostToPSN(&psn, e1); CFRelease(e1); e2 = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)125, false); CGEventPostToPSN(&psn, e2); CFRelease(e2); And here's where I switch focus, also working (except when first required): //click in text input box - point is derived earlier e6 = CGEventCreateMouseEvent(NULL, kCGEventLeftMouseDown, point, 0); CGEventPostToPSN(&psn, e6); CFRelease(e6); e7 = CGEventCreateMouseEvent(NULL, kCGEventLeftMouseUp, point, 0); CGEventPostToPSN(&psn, e7); CFRelease(e7); //press tab key to move to chat log table CGEventRef e = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)48, true); //CGEventPost(kCGSessionEventTap, e); CGEventPostToPSN(&psn, e); CFRelease(e); CGEventRef e11 = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)48, false); CGEventPostToPSN(&psn, e11); CFRelease(e11);

    Read the article

  • QTreeView memory consumption

    - by Eye of Hell
    Hello. I'm testing QTreeView functionality right now, and i was amazed by one thing. It seems that QTreeView memory consumption depends on items count O_O. This is highly unusual, since model-view containers of such type only keeps track for items being displayed, and rest of items are in the model. I have written a following code with a simple model that holds no data and just reports that it has 10 millions items. With MFC, Windows API or .NET tree / list with such model will take no memory, since it will display only 10-20 visible elements and will request model for more upon scrolling / expanding items. But with Qt, such simple model results in ~300Mb memory consumtion. Increasing number of items will increase memory consumption. Maybe anyone can hint me what i'm doing wrong? :) #include <QtGui/QApplication> #include <QTreeView> #include <QAbstractItemModel> class CModel : public QAbstractItemModel { public: QModelIndex index ( int i_nRow, int i_nCol, const QModelIndex& i_oParent = QModelIndex() ) const { return createIndex( i_nRow, i_nCol, 0 ); } public: QModelIndex parent ( const QModelIndex& i_oInex ) const { return QModelIndex(); } public: int rowCount ( const QModelIndex& i_oParent = QModelIndex() ) const { return i_oParent.isValid() ? 0 : 1000 * 1000 * 10; } public: int columnCount ( const QModelIndex& i_oParent = QModelIndex() ) const { return 1; } public: QVariant data ( const QModelIndex& i_oIndex, int i_nRole = Qt::DisplayRole ) const { return Qt::DisplayRole == i_nRole ? QVariant( "1" ) : QVariant(); } }; int main(int argc, char *argv[]) { QApplication a(argc, argv); QTreeView oWnd; CModel oModel; oWnd.setUniformRowHeights( true ); oWnd.setModel( & oModel ); oWnd.show(); return a.exec(); }

    Read the article

  • Xcode + Perforce: it frequently shows me the spinning wheel for no reason! What can i do?

    - by GamingHorror
    While working on an Xcode project i keep getting the spinning wheel while switching files, scrolling, searching, typing, debugging, removing breakpoints, switching back from another app or saving. It also happens before compiling but usually it just happens from time to time for no apparent reason. This is the second time this started happening in a Xcode project and it's driving me nuts. It completely breaks my flow of work to have to wait for the spinning wheel to go away (2-5 seconds). What on earth could i possibly do to ... figure out what's causing the problem? resolve the problem? More details: When any project is small, everything is super-smooth with Xcode and Perforce. Two of my projects eventually had this spinning wheel problem after about 4 weeks of work. It only happened with those two projects so far. They consist of around 1000-1200 files in source control, most of them assets. The problem occurs even if i manually check out the whole project in Perforce. The problem is gone when i copy the project directory and work in the copy which is no longer under source control, or if i create a branch in Perforce and work in the branch (under source control). One of these projects i shared with a colleague, and he had exactly the same issues on his Mac. We eventually switched to Subversion and the spinning-wheel issue immediately went away. Now that i've received an updated copy of the project and simply put it under Perforce as a new project, the problem also went away (so far it did not resurface). It leads me to think that it may be caused by a larger number of file revisions. The server itself (version 2009.1) is on a different (Windows) machine on my LAN, so there's definetely no Internet lag involved. The complete repository is just 1 GB in size spread over a dozen projects or so. I'm sorry if the question seems more like a support inquiry for Perforce. However i'm using the free version of Perforce so i'm not entitled to get support from them. I hope no one minds me asking here. I'm really bummed out by this. I don't want to have to create a new branch for the project each time the spinning wheel problem surfaces.

    Read the article

  • Cell contents changing for rows present outside the height of tableview(to see this cells, we shud s

    - by wolverine
    I have set the size of the tableView that I show as the popoverController as 4*rowheight. And I am using 12cells in the tableView. Each cell contains an image and a label. I can see all the cells by scrolling. Upto 5th cell its ok. After th2 5th cell, the label and the image that I am using in the first four cells are being repeated for the remaining cells. And If I select the cell, the result is accurately shown. But when I again take the tableView, the image and labels are not accurate even for the first 5 cells. All are changed but the selection is giving the correct result. Can anyone help me?? - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [self tableviewCellWithReuseIdentifier:CellIdentifier rowNumber:indexPath.row]; } //tableView.backgroundColor = [UIColor clearColor]; return cell; } - (UITableViewCell *)tableviewCellWithReuseIdentifier:(NSString *)identifier rowNumber:(NSInteger)row { CGRect rect; rect = CGRectMake(0.0, 0.0, 360.0, ROW_HEIGHT); UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:rect reuseIdentifier:identifier] autorelease]; UIImageView *myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10.00, 10.00, 150.00, 100.00)]; myImageView.tag = IMAGE_TAG; [cell.contentView addSubview:myImageView]; [myImageView release]; UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(170.00, -10.00, 170.00, 80.00)]; label.tag = LABEL_TAG; [label setBackgroundColor:[UIColor clearColor]]; [label setTextColor:[UIColor blackColor]]; [label setFont:[UIFont fontWithName:@"AmericanTypewriter" size:22]]; [label setTextAlignment:UITextAlignmentLeft]; [cell.contentView addSubview:label]; [label release]; if (row == 0) { UIImageView *imageView = (UIImageView *)[cell viewWithTag:IMAGE_TAG]; imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"cover_v.jpg"]]; UILabel *mylabel = (UILabel *)[cell viewWithTag:LABEL_TAG]; mylabel.text = [NSString stringWithFormat:@"COVER PAGE"]; } }

    Read the article

  • Keeping floated divs inline

    - by Elliott
    I'm having trouble getting my layout working correctly, I have a main div and a sidebar div these are both float: left if the screen size is resized or if its viewed on screen smaller that what I have designed on (1920x1080) then the sidebar div drops below the main content. I tried placing a wrapper around each div, but this has no effect. <div id="header"> [Header] </div> <div id="content"> [Content] </div> <div id="sideBar"> [SideBar] </div> <div id="footer"> [Footer] </div> body { width: 100%; color: #000000; background-color: #000000; margin: 0; padding: 0; } #header { width: 100%; height: 110px; background-color: #336699; color: #FFFFFF; margin: 0px; padding: 0px; } #content { float: left; margin-left: 50px; width: 70%; height: 700px; margin-top: 40px; padding: 30px; background-color: #FFFFFF; margin-bottom: 40px; } #sideBar { float: left; margin-left: 50px; width: 15%; height: 400px; margin-top: 40px; padding: 30px; background-color: #FFFFFF; } #footer { width: 100%; height: 80px; background-color: #174555; margin: 0px; padding: 0px; color: #ffffff; clear: both; } Basicly both div's should resize until a certain size is reached, then scrolling should be enabled. I'm pretty sure I have done something simple wrong but i'm not much of a design person. Example can be shown here : Link Thanks for any advice :)

    Read the article

  • ListBox ,ScrollViewer ? CanContentScroll

    - by mrK
    Hi! I have ListBox with ScrollViewer <ScrollViewer Focusable="False" CanContentScroll="True" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Disabled"> <ListBox ItemsSource="{Binding Path=MyItems}" VerticalAlignment="Stretch" Focusable="False"> <ListBox.ItemContainerStyle> <Style TargetType="{x:Type ListBoxItem}"> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="HorizontalContentAlignment" Value="Stretch"/> <Setter Property="VerticalContentAlignment" Value="Stretch"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ListBoxItem}"> <Border CornerRadius="3,3,3,3"> <Grid> <myControls:MyControl/> </Grid> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> </ListBox.ItemContainerStyle> <ListBox.Style> <Style TargetType="ListBox"> <Setter Property="SnapsToDevicePixels" Value="true"/> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.CanContentScroll" Value="True"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ListBox"> <ScrollViewer Focusable="False" CanContentScroll="True"> <Border> <StackPanel Margin="2" Orientation="Horizontal" IsItemsHost="True"/> </Border> </ScrollViewer> </ControlTemplate> </Setter.Value> </Setter> </Style> </ListBox.Style> </ListBox> </ScrollViewer> But CanContentScroll="True" does't work. It's still scrolling in physical units. Whats wrong in my code? Thanks!

    Read the article

  • ScrollViewer in a ListBox not working. WPF.

    - by guest
    Hi, I have the following defined in my control: <local:TestListBox.ItemTemplate> <DataTemplate> <Border x:Name="eventBorder" Width="{Binding ElementName=eventsLbx, Path=ActualWidth,BorderBrush="{Binding Color}" BorderThickness="1" CornerRadius="4"> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientStop x:Name="StartGradient" Color="#FFFFFFFF" Offset="0"/> <GradientStop x:Name="EndGradient" Color="{Binding Color}" Offset="1"/> </LinearGradientBrush> </Border.Background> <Border.ToolTip> <ToolTip Content="{Binding Text}"/> </Border.ToolTip> <TextBlock TextTrimming="CharacterEllipsis" HorizontalAlignment="Center" FontSize="12" Text="{Binding Text}" /> </Border> <DataTemplate.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter TargetName="eventBorder" Property="Background" Value="#FFE4EBF5"/> </Trigger> </DataTemplate.Triggers> --> </DataTemplate> </local:TestListBox.ItemTemplate> </local:TestListBox> </ScrollViewer.Content> </ScrollViewer> </Grid> <ControlTemplate.Triggers> <Trigger SourceName="eventsLbx" Property="HasItems" Value="False"> <Setter TargetName="eventsLbx" Property="Visibility" Value="Hidden"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> Now if there are more items than are visible, then the scrollviewer appears properly but the user CANNOT drag the scrollviewer middle button for scrolling. The user can click on the arrows at the end of the scrollviewer to scroll but he cannot click the bar that appears on the scrollbar and drag it to actually scroll the contents. I cannot figure out why this is happening...

    Read the article

  • iPhone: custom cell is overlaping with each other

    - by Nandakishore
    hi i am working on Table view, my Table view first custom cell is over ride other cell when Scrolling this is my code import UIKit/UIKit.h @interface MyTweetViewController : UIViewController { IBOutlet UITableView *tweetsTableView; NSMutableArray *tweetArray; } @property (nonatomic, retain) IBOutlet UITableView *tweetsTableView; @end import "MyTweetViewController.h" @implementation MyTweetViewController @synthesize tweetsTableView; (void)viewDidLoad { tweetArray = [[NSMutableArray alloc] init]; [tweetsTableView setBackgroundColor:[UIColor clearColor]]; [super viewDidLoad]; } pragma mark - pragma mark Table view data source (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections. return 1; } (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of rows in the section. return [tweetArray count]; } (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 80; } - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { [cell setBackgroundColor:[UIColor clearColor]]; } //Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *identifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; if(!cell) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewStyleGrouped reuseIdentifier:identifier]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } cell.accessoryType = UITableViewCellAccessoryNone; UILabel * name = [[UILabel alloc]initWithFrame:CGRectMake(72,3,242,15)]; name.text = (NSString*)[(Tweet*)[tweetArray objectAtIndex:indexPath.row] userName]; [name setFont:[UIFont fontWithName:@"Helvetica" size:14]]; name.textColor=[UIColor colorWithRed:250 green:250 blue:210 alpha:0.5]; [name setBackgroundColor:[UIColor clearColor]]; UILabel * tweetLabel = [[UILabel alloc]initWithFrame:CGRectMake(72,20,242,60)]; tweetLabel.text = (NSString*)[(Tweet*)[tweetArray objectAtIndex:indexPath.row] tweet]; tweetLabel.numberOfLines = 3; tweetLabel.textColor=[UIColor colorWithRed:252 green:148 blue:31 alpha:1]; [tweetLabel setFont:[UIFont fontWithName:@"Helvetica" size:12]]; [tweetLabel setBackgroundColor:[UIColor clearColor]]; NSLog(@" lblUserTweet : %@ ",name.text); UIImageView *myImage = [[UIImageView alloc]initWithFrame:CGRectMake(6,3,58,49)]; NSURL url = [NSURL URLWithString:[(Tweet)[tweetArray objectAtIndex:indexPath.row] image_url]]; NSData *data = [NSData dataWithContentsOfURL:url]; [myImage setImage: [UIImage imageWithData:data]]; [cell.contentView addSubview:myImage]; [cell.contentView addSubview:tweetLabel]; [cell.contentView addSubview:name]; return cell; } (void)dealloc { [tweetsTableView release]; [tweetArray release]; [super dealloc]; }

    Read the article

  • Rendering problem with UITableview

    - by Spider-Paddy
    I have a very strange problem with a UITableview within a navigation controller on the iPhone simulator. Of the cells displayed, only some are correctly rendered. They are all supposed to look the same but the majority are missing the accessory I've set, scrolling the view changes which cell has the accessory so I suspect it's some sort of cell caching happening, although the contents are correct for each cell. I also set an image as the background and that was also only displaying sporadically but I fixed that by changing cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yellow-bar_short.png"]]; (which also only rendered a random cell with the background) to cell.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"yellow-bar_short.png"]]; I now need to fix the problem with the accessory only showing on a random cell. I tried moving the code from cellForRowAtIndex to willDisplayCell but it made no difference. I put in a log command to confirm that it is running through each frame. Basically it's a table view (UITableViewCellStyleSubtitle) that gets its info from a server & is then updated by a delegate method calling reload. Code is: -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"%@", [NSString stringWithFormat:@"Setting colours for cell %i", indexPath.row]); // Set cell background // cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yellow-bar_short.png"]]; cell.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"yellow-bar_short.png"]]; cell.textLabel.backgroundColor = [UIColor clearColor]; cell.detailTextLabel.backgroundColor = [UIColor clearColor]; // detailTableViewAccessory is a view containing an imageview in this view's nib // i.e. nib <- view <- imageview <- image cell.accessoryView = detailTableViewAccessory; } // Called by data fetching object when done -(void)listDataTransferComplete:(ArticleListParser *)articleListParserObject { NSLog(@"Data parsed, reloading detail table"); self.currentTotalResultPages = (((articleListParserObject.currentArticleCount - 1) / 10) + 1); self.detailTableDataSource = [articleListParserObject.returnedArray copy]; // make a local copy of the returned array // Render table again with returned array data (neither of these 2 fixed it) [self.detailTableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO]; // [self.detailTableView reloadData]; // Re-enable necessary buttons (including table cells) letUserSelectRow = TRUE; [btnByName setEnabled:TRUE]; [btnByPrice setEnabled:TRUE]; // Remove please wait message NSLog(@"Removing please wait view"); [pleaseWaitViewControllerObject.view removeFromSuperview]; } I only included code that I thought was relevant, can supply more if needed. I can't test it on an iPhone yet so I don't know if it's maybe just a simulator anomaly or a bug in my code. I've always gotten good feedback from questions, any ideas?

    Read the article

  • GTK+ widgets/windows being (randomly) corrupted, with what seems to be timers.

    - by nubela
    Hi, I have recently implemented a scrolling text across an area of limited screen estate using a timers repeating every 100ms, and some simple string appending. However, after this very implementation, I have come to realise that my GUI is getting randomly bugged/corrupted after a certain while. That is to say that some widgets/windows become completely white, and eventually the entire GUI turns white and unclickable. What is weird is that there is no error debug output at all. Having said that, I am using Mono with GTK-Sharp for the application. Does anyone have an idea or a possible clue how and why this is happening? If not, how can I further debug this properly? Thanks, really appreciate it. PS: Sometimes, it takes up to 1.5 hours for the thing to start corrupting, it has random timeframes for it to start happening. This is my the code implemented that caused this issue: void ScrollSyncTo(object sender, System.Timers.ElapsedEventArgs e) { //initial check if it fits nicely alr if (sync_to_full_txt.Length <= sync_to_max_char) { sync_to_timer.Stop(); return; } //check for pause if (sync_to_pause >= 0) { sync_to_pause--; return; } //check direction int temp_psn; string temp_str; if (sync_to_direction) { temp_psn = sync_to_posn + 1; if (sync_to_full_txt.Substring(temp_psn).Length < sync_to_max_char) { sync_to_pause = sync_to_break_steps; sync_to_direction = false; sync_to_posn = sync_to_full_txt.Length - 1; System.GC.Collect(); return; } else { temp_str = sync_to_full_txt.Substring(temp_psn, sync_to_max_char); } } else { temp_psn = sync_to_posn - 1; if (temp_psn + 1 < sync_to_max_char) { sync_to_pause = sync_to_break_steps; sync_to_direction = true; sync_to_posn = 0; System.GC.Collect(); return; } else { temp_str = sync_to_full_txt.Substring(temp_psn - sync_to_max_char + 1, sync_to_max_char); } } //lets move it sync_to.Text = temp_str; sync_to_posn = temp_psn; }

    Read the article

  • iPhone - NSURLConnection does not receive data

    - by Jukurrpa
    Hi, I have a pretty weird problem with NSURLRequest. I'm using them to make an asynchronous image loading in an UITableView. The first time the tableView displays, all connections from NSURLRequests open correctly but receive absolutely no data, regardless of how long I wait. But as soon as I scroll down in the tableView, the newly created requests for the new cells work perfectly! The only way for the images on top of the tableView to load is to make them disappear by scrolling down and then up again, in order to create new requests. Here is what I do in "cellForRowAtIndexPath": UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"]; if (cell == nil) { cell = [[UITableViewCell alloc] initWIthFrame:CGRectMake(0, 0, 300, 60)]; AsyncUIImageView imageView = [[AsynUIImageView alloc] initWithFrame:CGRectMake(0, 0, 60, 60)]; imageView.tag = IMG_VIEW // an enum for tags [cell addSubView:imageView]; [imageView release]; } AsyncUIImageView imageView = (AsyncUIImageView*)[cell viewWithTag:IMG_VIEW]; // I do a few cache checks here, but if the image aint cached I do this: [imageView loadImageFromURL:@"http://someurl.com/somepix.jpg"]; // all urls are different, just an example The AsyncUIImageView inherits from UIImageView and contains an NSURLConnection which opens upon calling the loadImageFromURL method: (void) loadImageFromURL:(NSString*)filename { if (self.connection != nil) [self.connection release]; if (self.data != nil) [self.data release]; NSURLRequest* request = [NSURLRequest requestWithURL:[[NSURL alloc] initWithString:fileName] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.0]; self.connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; if (self.connection == nil) return; self.data = [[NSMutableData data] retain]; } I've created the delegate methods "connection: didReceiveData", which appends received data to self.data and "connectionDidFinishLoading" which sets the image and closes the connection once the transfer is complete. These work, but are never called for the first requests I create. I suspect this bug to come from the main thread not giving the first requests the control so they can execute themselves, as the same behavior happens if I keep my finger on the screen after a scroll: connections open themselves, but no data is received until I stop touching the screen. What am I doing wrong?

    Read the article

  • Keeping Velocity Constant and Player in Position - Sidescrolling

    - by user2904951
    I'm working on a Little Mobile Game with Cocos2D-X and Box2D. The Point where I got stuck is the movement of a box2d-body (the main actor) and the according Sprite. Now I want to : move this Body with a constant velocity along the x-axis, no matter if it's rolling (it's a circleshape) upwards or downwards keep the body nearly sticking to the ground on which it's rolling keep the Body and the according Sprite in the Center of the Screen. What I tried : in the update()- method I used body->SetLinearVelocity(b2Vec2(x,y)) to higher/lower values, if the Body was passing a constant value for his velocity I used to set very high y-Values in body->SetLinearVelocity(b2Vec2(x,y)) First tried to use CCFollow with my playerSprite, which was also Scrolling along the y-axis, as i only need to scroll along the x-axis, so I decided to move the whole layer which is containing the ambience (platforms etc.) to the left of my Screen and my Player Body & Player sprite to the right of the Screen, adjusting the speed values to Keep the Player in the Center of the Screen. Well... ...didn't work as i wanted it to, because each time i set the velocity manually (I also tried to use body->applyLinearImpulse(...) when the Body is moving upwards just as playing around with the value of velocityIterations in world->Step(...)) there's a small delay, which pushes the player Body more or less further of the Center of the Screen. ... didn't also work as I expected it to, because I needed to adjust the x-Values, when the Body was moving upwards to Keep it not getting slowed down, this made my Body even less sticky to the ground.... ... CCFollow did a good Job, except that I didn't want to scroll along the y-axis also and it Forces the overgiven sprite to start in the Center of the Screen. Moving the whole Layer even brought no good results, I have tried a Long time to adjust values of the movement Speed of the layer and the Body to Keep it negating each other, that the player stays nearly in the Center of the Screen.... So my question is : Does anyone of you have any Kind of new Approach for me to solve this cohesive bunch of Problems ? Cheers, Seb

    Read the article

< Previous Page | 60 61 62 63 64 65 66 67 68 69 70  | Next Page >