Search Results

Search found 2796 results on 112 pages for 'switching desktops'.

Page 13/112 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Switching textstorage of NSTextViews back and forth

    - by Jakob Dam Jensen
    I'm trying to make a feature in a product which gives the user the ability to split a textview into two. The way this is done is by removing the textview from it's superview, making a NSSplitView and adding the textview as well as a new NSTextView instance to this splitview. Lastly I make these two textviews share the same textstorage in order to make them share the same content. It works great. But the problem is when I want to make one of the two textviews change textstorage. The replaceTextStorage method in NSLayoutManager causes both NSTextView to change textStorage. The API documentation states: replaceTextStorage: All NSLayoutManager objects sharing the original NSTextStorage object then share the new one. This method makes all the adjustments necessary to keep these relationships intact, unlike setTextStorage:. So it makes sense that it would do this. But the question is how do I make it possible to have two (or more) textviews first share the same storage and after that having them using their own? I've tried replacing the layoutManager and even making new instances of NSTextViews but no luck... Any suggestions?

    Read the article

  • Switching/Linking to another external stylesheet in a .js file using Ruby on Rails

    - by Jake
    Im learning JQuery from a Sitepoint Book but Im trying to apply all the lessons to a Rails App. In one lesson, we are taught how to switch to a different stylesheet if the browser window is resized beyond a certain point. Here's the javascript code: if ($('body').width() > 900) { $('<link rel="stylesheet" href="wide.css" type="text/css" />') .appendTo('head'); } else { $('link[href=wide.css]').remove(); } Rails doesn't seem to want to link to the new stylesheet using 'link rel'. I've tried using the Rails helper: <%= stylesheet_link_tag 'base', :media => 'screen' %> but that doesn't work in a .js file. How do I link to an external stylesheet in a .js file using Ruby? Can I use Ruby on Rails code in a .js file? Thanks.

    Read the article

  • jQuery appendTo (switching back and forth)

    - by Starboy
    So what I'm trying to accomplish is a simple appendTo a certain element. The issue I'm having is after execute is run, it appends to the location but then proceed to go back to the ul it resides in. <script type="text/javascript"> function execute() { $('#desCopy').appendTo('#description') $('#imgPlace').appendTo('#IMGbox') } </script> <div id="content" style="background:#000; width:989px;"> <div style="float:left; left:18px; margin:0; width:337px; position:relative; padding:15px 0 0 0; color:#FFF;"> <div id="description"> </div> </div> <div id="IMGbox" style="float:left; position:relative; display:block; background:#F00; width:652px; height:258px; background:#0FF; overflow:hidden;"> </div> <div style="float:right; background:#CCC; height:25px; width:652px;"> <ul> <li><a href="" onclick="execute()">Slide 1</a> <ul style=""> <li><span id="desCopy">Test description, Test description</span></li> <li><img src="images/test.jpg" id="imgPlace"></li> </ul> </li> </ul> </div> </div>

    Read the article

  • Background color remaining when switching views

    - by Guy
    Hi Guys. I have a UIViewController named equationVC who's user interface is being programmatically created from another NSObject class called equationCon. Upon loading equationVC, a method called chooseInterface is called from the equationCon class. I have a global variable (globalVar) that points to a user defined string. chooseInterface finds a method in the equationCon class that matches the string globalVar points to. In this case, let's say that globalVar points to a string that is called "methodThatMatches." In methodThatMatches, another view controller needs to show the results of what methodThatMatches did. methodThatMatches creates a new equationVC that calls upon methodThatMatches2. As a test, each method changes the color of the background. When the application starts up, I get a purple background, but as soon as I hit backwards I get another purple screen, which should be yellow. I do not think that I am release the view properly. Can anyone help? -(void)chooseInterface { NSString* equationTemp = [globalVar stringByReplacingOccurrencesOfString:@" " withString:@""]; equationTemp = [equationTemp stringByReplacingOccurrencesOfString:@"'" withString:@""]; SEL equationName = NSSelectorFromString(equationTemp); NSLog(@"selector! %@",NSStringFromSelector(equationName)); if([self respondsToSelector:equationName]){ [self performSelector:equationName]; } } -(void)methodThatMatches{ self.equationVC.view.backgroundColor = [UIColor yellowColor]; [setGlobalVar:@"methodThatMatches2"]; EquationVC* temp = [[EquationVC alloc] init]; [[self.equationVC navigationController] pushViewController:temp animated:YES ]; [temp release]; } -(void)methodThatmatches2{ self.equationVC.view.backgroundColor = [UIColor purpleColor]; }

    Read the article

  • 'Bank Switching' Sprites on old NES applications

    - by Jeffrey Kern
    I'm currently writing in C# what could basically be called my own interpretation of the NES hardware for an old-school looking game that I'm developing. I've fired up FCE and have been observing how the NES displayed and rendered graphics. In a nutshell, the NES could hold two bitmaps worth of graphical information, each with the dimensions of 128x128. These are called the PPU tables. One was for BG tiles and the other was for sprites. The data had to be in this memory for it to be drawn on-screen. Now, if a game had more graphical data then these two banks, it could write portions of this new information to these banks -overwriting what was there - at the end of each frame, and use it from the next frame onward. So, in old games how did the programmers 'bank switch'? I mean, within the level design, how did they know which graphic set to load? I've noticed that Mega Man 2 bankswitches when the screen programatically scrolls from one portion of the stage to the next. But how did they store this information in the level - what sprites to copy over into the PPU tables, and where to write them at? Another example would be hitting pause in MM2. BG tiles get over-written during pause, and then get restored when the player unpauses. How did they remember which tiles they replaced and how to restore them? If I was lazy, I could just make one huge static bitmap and just grab values that way. But I'm forcing myself to limit these values to create a more authentic experience. I've read the amazing guide on how M.C. Kids was made, and I'm trying to be barebones about how I program this game. It still just boggles my mind how these programmers accomplisehd what they did with what they had. EDIT: The only solution I can think of would be to hold separate tables that state what tiles should be in the PPU at what time, but I think that would be a huge memory resource that the NES wouldn't be able to handle.

    Read the article

  • Is switching to PHP 5.3 a good idea?

    - by understack
    I'm using PHP 5.2.11. I've seen that 5.3 version has several backward incompatibility issues and because of that some code might require changes. Since my website is hosted on shared server, many have suggested that those server won't upgrade to 5.3 in near future (probably due to incompatibility issues for many shared users). Would it be wise to develop a new project in 5.3 which would be hosted on shared server?

    Read the article

  • MPMoviePlayerController switching movies causes white flash

    - by bennythemink
    Hi guys, I have a small UIView that displays a repeated movie. When the user taps a button another movie is loaded and displayed in the same UIView. The problem is that there is a half second "flash" between the removing of the first movie and the displaying of the second. Is there any to remove this? <code> - (void) setUpMovie:(NSString*)title { NSString *url = [[NSBundle mainBundle] pathForResource:title ofType:@"mp4"]; MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:url]]; [[player view] setFrame:self.movieView.bounds]; [self.movieView addSubview:player.view]; if ([title isEqualToString:@"Bo_idle_02"]) { [player setRepeatMode:MPMovieRepeatModeOne]; } else { [player setRepeatMode:MPMovieRepeatModeNone]; } [player setControlStyle:MPMovieControlStyleNone]; [player play]; } - (void) startDanceAnimation { [self setUpMovie:@"Bo_dance_02"]; return; } </code>

    Read the article

  • iPhone SDK: Switching to one view then back to previous view errors

    - by Nic Hubbard
    I have a UITabBarConroller that I use to switch between 3 different views. This all works perfectly. On one of my tabs, I added a button at the to called "Add", I have added an outlet to this, as well as an IBAction method which looks like the following: // Method used to load up view where we can add a new ride - (IBAction)showAddNewRideView { MyRidesViewController *controller = [[MyRidesViewController alloc] initWithNibName:@"AddNewRide" bundle:nil]; controller.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentModalViewController:controller animated:YES]; [controller release]; }//end showAddNewRideView This currently works fine, and loads up my AddNewRide nib file. But, once that view loads, I have a cancel button, which, when clicked, I want to return to the previous view. So, I figured I would just do the reverse of the above, using the following method which would load back my previous nib: - (IBAction)cancelAddingNewRide { MyRidesViewController *controller = [[MyRidesViewController alloc] initWithNibName:@"MainWindow" bundle:nil]; controller.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentModalViewController:controller animated:YES]; [controller release]; }//end cancelAddingNewRide But, which trying to load the MainWindow nib, the program crashes, and I get the following error: 2010-05-05 20:24:37.211 Ride[6032:207] *** -[MyRidesViewController cancelAddingNewRide]: unrecognized selector sent to instance 0x501e450 2010-05-05 20:24:37.213 Ride[6032:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[MyRidesViewController cancelAddingNewRide]: unrecognized selector sent to instance 0x501e450' So, I am a little lost as to why it would work one way, but not the other.

    Read the article

  • JQuery-tmpl Template Switching Not working.

    - by Mike
    I'm trying to implement "more/less" functionality using the official jquery-tmpl plugin. I've looked at the examples, but I cannot seem to get the functionality to work in my own implementation. When I click on one of my "More" buttons, I seem to get an error thrown of: Uncaught TypeError: Property 'tmpl' of object #<an Object> is not a function This is my implementation here From what I can tell, the example I'm trying to replace is doing the following: Render the "Master" template On-click: Find the corresponding template object (tmplItem) to the clicked element. Pass in reference to a new template. Call the update function to re-render. Have I understood the documentation wrong? From what I can tell I'm doing the same thing as the example on the official documentation.

    Read the article

  • SEO and dynamic javascript HTML switching

    - by Gazow
    just wondering if anyone knows anything of using javascript to set html to new content instead of linking to new pages, if this is generally a bad idea or if it kind of hurts SEO(which im kind of new to) Basically the home page displays given content, and the links to like contact pages and stuff, just change the body content to what would normally be a separate html page. my OCD kinda bugs me when pages reload and either flash the background or its offset somehow, so i wanted to know if making sites like this was a bad idea or whatever- i suppose at the least, i could create duplicates/hidden pages for SEO purposes

    Read the article

  • UIPickerView crashing when switching segemented control

    - by Mattog1456
    Hello, I have four NSDictionaries that I would like to use to populate a pickerview depending on a segemented control. With the code I have, the first segmented control/pickerview works fine but when I switch to the second segment the picker view only loads part of the second dictionary, that is it loads the same number of rows as it counted in the first dictionary. When I change the segmented control to the third or fourth segment it simply crashes with a sigabrt error indicating that it cannot index item43 when only 27 exist. This I suspect stems from a UItextfield population based on the upickerview row and object. I think the problem is with the way I have the data source and delegate set up. #pragma mark - #pragma mark UIPickerViewDelegate - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { if ([wine selectedSegmentIndex] == 0) { return [robskeys objectAtIndex:row]; } if ([wine selectedSegmentIndex] == 1) { return [esabskeys objectAtIndex:row]; } if ([wine selectedSegmentIndex] == 2) { return [lebskeys objectAtIndex:row]; } else if ([wine selectedSegmentIndex] == 3) { return [sbskeys objectAtIndex:row]; } return @"Unknown title"; } #pragma mark - #pragma mark UIPickerViewDataSource - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { return 1; } - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { if ([wine selectedSegmentIndex] == 0) { return robskeys.count; } if ([wine selectedSegmentIndex] == 1) { return esabskeys.count; } if ([wine selectedSegmentIndex] == 2) { return lebskeys.count; } else if ([wine selectedSegmentIndex] == 3) { return sbskeys.count; } return 1; } #pragma mark - Any help would be much appreciated Thank you

    Read the article

  • Presta Shop Switching Domain Issue

    - by Hammad Khalid
    I have a website made on Presta Shop CMS. I had it on my trial server. The installation and everything. It works and runs fine. I then copied (using FTP) every file from my trial server to the main domain. I did not install it on the main domain (bought from network solutions), but copied everything there. The issue is when i hit the main domain, it somewhat redirects me back to the trial server. I have checked and changed many of the default values. and many values in the database. But still havent had luck. Also made changes in the .htaccess file, still without any luck. I do not want to go through the installation process again on my main domain. You can check the site (main domain :- www.myworld-myhome.com, it will redirect you to hrm.com/esol/ )

    Read the article

  • Switching from one connectionstring to another when moving from development to cloud

    - by Nancy Walker
    Hello, I am working on a cloud application. When I test out the application on my computer I want to have my connection string set as follows in ServiceConfiguration.cscfg: <Setting name="DataConnectionString" value="UseDevelopmentStorage=true" /> When I publish to the cloud I need to have it set as follows: <Setting name="DataConnectionString" value="DefaultEndpointsProtocol=https;AccountName=xxxx;AccountKey=yyy" /> I keep going from one environment to the other and keep having to change the DataConnectionString. Is there a way that I can automate this? I looked around and can't see any examples but I'm sure some others have the same problem as me. Thanks, Nancy

    Read the article

  • android:black screen switching between activity

    - by 100rabh
    Hi, I am using below code from one of my activity to start another Intent viewIntent = new Intent (getApplicationContext (), landingPage.class); Bundle b = new Bundle (); b.putString ("ApplicationName", a_Bean.getApplicationName ()); if (landingPage.getInstanceCount () < 1) bp.landingPage_ProgressDialog = ProgressDialog.show (ViewAllApp.this, "Please wait...", "Retrieving data...", true, false); viewIntent.putExtras (b); viewIntent.addFlags (Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivityForResult (viewIntent,10); Thread background=new Thread(new Runnable() { public void run() { Progresshandler.sendMessage(handler.obtainMessage());//finishes progressDialog }}); background.start (); but after startactivity it shows a black screen & then displays new activity. Can I make progressdialog to be shown while the black screen is displayed??

    Read the article

  • switching C compiler causes: Error Initializer cannot be specified for a flexible array member

    - by user1054210
    I am trying to convert our code from one IDE to be used in a different one. The current one uses gcc which allows for this structure to be initialized from a variable array. The new tool does not use gcc gives me an error "Initializer cannot be specified for a flexible array member". So can someone help me understand how to set this up? Should I set up a blank array of variable size and then somewhere assign the #define array as seen below? Here would be an example of the code…(this is current implementation current IDE) In one header file that is Build switchable so we can build this on different hardware platforms we have the following #define #define GPIOS \ /* BANK, PIN, SPD, MODE,… */ GPIOINIT( A, 0, 2, AIN, …) \ GPIOINIT( A, 1, 2, AIN, …) \ GPIOINTINIT(A, 2, 2, AIN, …) \ . . . Then in a different header file that is used in all builds we have PLATFORM_CONFIG_T g_platformConfig = { .name = {PLATFORM_NAME}, (bunch of other stuff), .allGpios = { GPIOS /* here I get the error */ }, }; So I am thinking I can make the error line a variable array and assign to it later in some other way? The problem is the actual array "GPIO" is of different types and pin orders on different designs are different.

    Read the article

  • delegate method throws runtime "unrecognized selector" error when switching back from one UIViewCont

    - by chimgrrl
    Ok, I've spend like half day on this and it's killing me. So I've got 3 view controllers transitioning from one another, something like this: I call the UploadDecisionViewController after destroying the previous View Controller: [self dismissModalViewControllerAnimated:YES]; [self performSelector:@selector(showUDModalView) withObject:nil afterDelay:0.5]; In my showUDModalView method: - (void)showUDModalView { UploadDecisionViewController *udcontroller = [[UploadDecisionViewController alloc] initWithNibName:@"UploadDecisionViewController" bundle:nil]; udcontroller.delegate = self; [self presentModalViewController:udcontroller animated:YES]; [udcontroller release]; } The UploadDecisionViewController shows up no problem. The UploadDecisionViewController has a button, which when clicked I want it to transition to the FileUploadViewController. I setup a UploadDecisionDelegate, threw a method in there to handle the button clicking: Inside UploadDecisionDelegate protocol (UploadDecisionViewController.h): @protocol UploadDecisionDelegate //let UOnliveViewController know that a button was selected - (void)UploadDecisionViewController:(UploadDecisionViewController *)controller madeChoice:(NSString *)whichDirection; @end Then inside my IBAction method when the button is clicked, I have this: - (IBAction)decisionSelected:(id)sender { [delegate UploadDecisionViewController:self madeChoice:@"upload"];//crashing at this line } When I run this, at this line above it is throwing a runtime exception: 2010-06-09 12:48:59.561 UOnlive[4735:207] *** -[UIView UploadDecisionViewController:madeChoice:]: unrecognized selector sent to instance 0x3b65420 2010-06-09 12:48:59.562 UOnlive[4735:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIView UploadDecisionViewController:madeChoice:]: unrecognized selector sent to instance 0x3b65420' 2010-06-09 12:48:59.563 UOnlive[4735:207] Stack: ( 33502299, 2495698185, 33884219, 33453686, 33306306, 20618, 2982917, 3390286, 3399023, 3394235, 3087839, 2996168, 3022945, 40156505, 33287040, 33283144, 40150549, 40150746, 3026863, 11700, 11554 ) Let me throw in the delegate method implemented also: - (void)UploadDecisionViewController:(UploadDecisionViewController *)controller madeChoice:(NSString *)whichDirection { NSLog(@"it got to here 245"); [self dismissModalViewControllerAnimated:YES]; if (yesOrNo) { //open up the FileUploadViewController and proceed to upload [self performSelector:@selector(showFUModalView) withObject:nil afterDelay:0.5]; } } Can someone tell me what the heck is going on? Thanks a bunch for the help...

    Read the article

  • Switching Javascript Function states

    - by webzide
    Dear experts, I would like to implement a API of Javascript that sort of resemble a light switch. For instance, there are two buttons on the actual HTML page act as the UI. Both of the buttons have event handlers that invokes a different function. Each function have codes that act like a state, for instance. button1.onclick=function (){ $("div").click( //code effects 2 ) } button2.onclick=function (){ $("div").click( //Code effects 2 ) } I the code works fine on the surface but the 2 state functions overlap. the effects is going to take place for the rest of the way until the next reload of the document. Basically what I want to achieve is that when 1 button is clicked, it will switch "OFF" the state of function invoked by the other button and vice versa. Thus, the effects achieved are unique are not overlapped. Is there anyway to achieve this or could any experts point me to the right direction. Thanks in advance.

    Read the article

  • iPhone switching views without first view being reset

    - by user298261
    Heya! I'm making a role-playing game, and I want to have a Map View and a Battle Screen. With the possibility of other screens as well. I thought the best way to achieve this was to use multiple NIB files. When I prototyped this by have one view that creates content, switches to the next view, and then back, the content on the original view was reset. How do I make it so that the first view doesn't reset the data each time it's loaded? Thanks!

    Read the article

  • problem while switching between Portrait and landscape in android views

    - by vnshetty
    In my application im going to display a web page in web view , it works fine but if i flip between landscape to portrait or vice versa, then it exits and comes to main page. wht is the prblm? logcat: 03-10 13:35:47.123: INFO/WindowManager(69): Setting rotation to 1, animFlags=1 03-10 13:35:47.242: INFO/ActivityManager(69): Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=2/1/1 nav=3/1 orien=2 layout=17 uiMode=17 seq=70} 03-10 13:35:47.363: INFO/UsageStats(69): Unexpected resume of com.mireader while already resumed in com.mireader 03-10 13:35:50.413: DEBUG/dalvikvm(69): GC_EXPLICIT freed 395 objects / 20424 bytes in 195ms

    Read the article

  • Switching layouts page jumping (improvement to script)

    - by Ricardo Zea
    Hello, I'm using this script to switch layouts in a page: $("span.switcher").click(function () { $("span.switcher").toggleClass("swap"); /*!*/ $("ol.search-results").fadeOut("fast", function() { $(this).fadeIn("fast").toggleClass("grid"); }); The script works fine, the problem I have is that if the switch view is down the page, the layout changes and then the page jumps back up. If I add 'return false' right where you see the /* ! */ in the second line the script doesn't work. Also, as you can see, I'm using < span instead of < a since I was told that using other element other than < a would stop the page from jumping. Any idea how to fix the jumping of the page? Thanks.

    Read the article

  • Switching to tabs to the right or left of the current tab in Notepad++

    - by Christopher Swiedler
    How can I switch to the document to the left or right of the current document in Notepad++? For example, if I have documents A, B, and C open, and I'm currently editing B, I would like a shortcut to be able to switch to A (Alt-LeftArrow or Ctrl-Pageup) or C (Alt-RightArrow or Ctrl-PageDown). Is this possible? All I've found is a way to switch to next or previous documents based on the "history" of when the document was last opened (Ctrl-Tab and Ctrl-Shift-Tab), which are useful, but not what I want.

    Read the article

  • iOS Switching an embedded view in storyboard

    - by Coyote6
    I have been trying to figure this out all day and I know it should be able to be done, but being new to iOS development using Objective-C and not Appcelerator I'm having newbie issues. What I am trying to accomplish is to have an embedded view in one of my other views, but to be able to switch which view is embedded through programming. I am using storyboards. When I tried to use the view container it displays the attached view, but I cannot attach multiple views to the container in the storyboard. I drew up an image, but to my annoyance I cannot post an image on here because I don't have enough "rep" points, so I posted it on my site: http://static.c6gx.com/images/iphone-embedded-views-diagram.jpg Later on I would like what appears to be a push segue, within that view container, but first I just want to be able to switch between embedded view 1, 2, 3, etc. Am I supposed to be using a view container to accomplish this, or some other type of controller? Then how would I call the transition to change the view? Thank you for any help you can provide.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >