Search Results

Search found 1599 results on 64 pages for 'pressed'.

Page 11/64 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Iphone SDK: pathFoResource:Nsstring problem -> playin MP3 files

    - by Kaya
    I am trying to get 10 mp3 files in the resources folder and play them when a button is pressed. I have entered name of the mp3 files in a NSMutableArray and read each one after the button is pressed. The problem is that pathForResource: is not working (returns nil). If i use the file name explicitly -like pathFoResource:@"song1.mp3" ofType:@"mp3"- but if i use pathForResource:valuem whwre valuem is an NSstring with value of song1 Hope you can help Regards NSString *cellValue0 = [listOfmp3 objectAtIndex:anumber]; NSString *valuem; if ( [cellValue0 length] 0 ) valuem = [cellValue0 substringToIndex:[cellValue0 length] - 4]; NSString *pdfPath2 = [[NSBundle mainBundle] pathForResource:valuem ofType:@"mp3"]; NSURL *url = [NSURL fileURLWithPath:pdfPath2];

    Read the article

  • Alternative Menu Items in NSMenu

    - by Nick Paulson
    Hi, I have an NSMenu that contains NSMenuItems with custom views. I want it so that when the alt button is pressed, the menu items would change part of their look (through their view). I found setAlternative in the NSMenuItem docs, however, in practice I could only get it to work with NSMenuItems without custom views. As soon as I set a custom view, all of the menu items would be displayed. Also, I tried getting keypress events while the menu was open. Due to the other run loop, NSApplication's sendEvent: doesn't receive events until after the menu is closed. Therefore, I can't just intercept the event coming in. Does anyone know how I can get notified, whether through delegation or subclassing, of when the alt key is pressed when a menu is opened?

    Read the article

  • W3Schools tutorial example not working with Coda on Mac

    - by Mark Szymanski
    I am following a JavaScript tutorial on the W3Schools website and I have the following code: <html> <head> <title>Hello!</title> </head> <body> <script type="text/javascript"> function confirmShow { var r = confirm("Press one...") if (r == true) { alert("Button pressed == OK") } if (r == false) { alert("Button pressed == Cancel") } } </script> <input type="button" onclick="confirmShow()" value="Show Confirm Box" /> </body> </html> and whenever I preview it in Coda or in Safari the alert never shows up. Thanks in advance!

    Read the article

  • Cocoa NSStatusBar Global HotKey

    - by Craig
    I have created an NSStatusBar cocoa application which sits in the system status bar. I want to assign a hotkey so that when pressed it toggles my applications and show the menu. Is this possible?, In my searching and experimenting I have found a few different ways of assigning global hot keys that can be pressed when your application is in the background but I can't find any way to problematically make the menu show. Is this possible?, If anyone thinks a way of assigning a global hotkey is best please post it. Thanks. One of the hotkey tutorials I found was on http://dbachrach.com/blog/2005/11/program-global-hotkeys-in-cocoa-easily/ for anyone interested.

    Read the article

  • Tkinter button bind

    - by rejinacm
    Hello, Help urgently.. This is my code: import Tkinter from Tkconstants import * tk = Tkinter.Tk() class MyApp: def __init__(self,parent): self.frame = Tkinter.Frame(tk,relief=RIDGE,borderwidth=2) self.frame.pack() self.message = Tkinter.Message(tk,text="Symbol Disolay") label=Tkinter.Label(self.frame,text="Is Symbol Displayed") label.pack() self.button1=Tkinter.Button(self.frame,text="YES") self.button1.pack(side=BOTTOM) self.button1.bind("<Button-1>", self.button1Click) self.button2=Tkinter.Button(self.frame,text="NO") self.button2.pack() self.button2.bind("<Button-1>", self.button2Click) def button1Click(self, event): "pressed yes" def button2Click(self, event): "pressed no" myapp = MyApp(tk) tk.mainloop() What shall i do in button1Click() and button2Click() so that they return "YES" or "NO" to my program in string format ???

    Read the article

  • Help with pyHook error.

    - by Shady
    Hey, I'm trying to make a global hotkey with pyhook in python that is supposed to work only with the alt key pressed. here is the source: import pyHook import pythoncom hm = pyHook.HookManager() def OnKeyboardEvent(event): if event.Alt == 32 and event.KeyID == 49: print 'HERE WILL BE THE CODE' hm.KeyDown = OnKeyboardEvent hm.HookKeyboard() pythoncom.PumpMessages() but when I execute, only works with the second press of the second key (number 1 = 49)... and give this error: http://img580.imageshack.us/img580/1858/errord.png How can I solve it? For work at the first pressed time.

    Read the article

  • How do I create an ImageView in java code, within an existing Layout?

    - by Dan T
    I'm looking for an easy way for the user to see how many drinks they've had for a BAC calculator. PICTURE OF THE APP, for reference On button press, I would like an image to be added to the screen, directly under the spinner and with left alignment. When I press the button again, I want another image to be added to the screen. So if I pressed the add beer button, a drawable of a beer would appear below the spinner. If I pressed the add beer button again, I want there to be TWO drawables of beers under the spinner, preferably with them being added from the right. (Also, having them reach their width limit, wrapping around, and starting again on the left, but below a full line, would be AWESOME) I can't figure out how to do this. I assume adding a ImageView in code to a relative layout (because it needs to be positioned to the right) would be the best route, but if it's possible in xml I'd be more than happy to use that. Any help?

    Read the article

  • How can I capture the keystroke that triggers "CellEndEdit" on a DataGridView in C#?

    - by Andy Stampor
    I have a DataGridView that is set to EditOnF2. I do some special processing of data in the CellEndEdit eventhandler that sets the value of the cell. I still want the functionality of the EditOnKeystrokeOrF2 of reverting to the original value when the Esc key is pressed. Unfortunately, at the CellEndEdit eventhandler, I don't see a way to tell what caused the CellEndEdit event to be fired. I only want to change the value of the cell if the Esc key is not pressed. How can I tell if it was or not? Edit: It is worth noting that the KeyDown event does not get fired when the cell is being edited, nor for the final ending keystroke. Edit2: I have tried the KeyPreview suggestion, but the form still does not capture the Escape key being pressed. Edit3: I've been experimenting with trying to get this working. I originally posted some of the following as a separate post, but feel it might be more relevant to include it here. I have a cell in a DataGridView that is now set to EditProgrammatically. To capture the keystroke that starts an edit, I am setting the cell.Value equal to the keystroke. However, this ruins the "Escape" functionality of the cell - when you press escape, instead of reverting to the original value, it reverts to the keystroke that I programmatically inserted into the cell. I believe that if I could set the "EditedFormattedValue" on a cell, this would be where I want to put my keystroke value, however this appears to be read only. How can I accomplish what I am attempting? An example to clarify: If the cell has a value of "54.3" in it, and I press the "9" key, it begins editing the cell and places a "9" there. If I hit Escape, instead of reverting to "54.3" it reverts to "9". What I want is for it to return to its original value of "54.3". So, I am trying to tackle this issue from both the beginning and the end. I think the real problem is that I am overwriting the original value and have no way to determine if I should revert it or not. Edit4: It looks like CellValidating might be worth using, but I am seeing strange behavior when I experiment with it. In a new project, I create the DataGridView and register for the various events and see that CellValidating is fired before the CellEndEdit. However, in my project where I am trying to get this to work, CellEndEdit is firing BEFORE CellValidating. Any ideas on what the difference might be?

    Read the article

  • jtextfield keyevent handling issue

    - by vamsi
    doesn't .getKeyCode( ) return the key's int value? Because i have set my jtextfield to listen to keylistener, and in the keytyped method, i check what key has been pressed. Here's a snippet of my code: JTextField jtf = new JTextField( ); jtf.addKeyListener( this ); . . . public void keyTyped( KeyEvent e ) { if( e.getKeyCode( ) == KeyEvent.VK_ENTER ) System.out.println( "pressed enter" ); } but everytime i type enter in the jtextfield, nothing happens, ie nothing prints.

    Read the article

  • javascript keypress function: case-insensitive a-z, numbers and a few special chars?

    - by user239831
    hey guys, $('.s').keyup(function(e) { if (!/[A-Za-z0-9]/.test(String.fromCharCode(e.which))) { return false; } I wonder what is the best regex solution for my application. I have an ajax-based search that should just trigger the search when actual characters are pressed like a-Z (upper and lowercase), numbers and maybe a questionmark, a dash(hyphen), and an exclamation mark. Also the spacebar should be enabled. Otherwise the ajax search would be triggered as well if the shift-, option, or control-key, is pressed. What's the easiest regex pattern to understand here? thank you for your help

    Read the article

  • How JQuery data validation plugin works on the submit action

    - by kwokwai
    Hi all, I am learning how to use JQuery validation plugin, and came across some questions about the JQuery magic that works on the sumbit action. I got a simple HTML form which has got an input text field like this: <form class="cmxform" id="commentForm" method="get" action=""> <input id="cname" name="name" size="25" class="required" minlength="2" /> <input class="submit" type="submit" value="Submit"/> </form> The magic happened when I tried not to input any data into the field and pressed the submit button. I saw an error message in red pop up, and no matter how hard and how many times I pressed the submit button, nothing was submitted. It seemed that there was some scripts that disabled the submit action, but I just couldn't find which lines of codes in the JQuery Validatyion Plugin that did it.

    Read the article

  • Workaround for richfaces combobox hotkey bug

    - by John
    Hi, Does anyone know a workaround for the bug https://jira.jboss.org/jira/browse/RF-8076 ? Just to clarify things, we have a form with multiple inputs, one of them being a combobox with auto complete features. We've setup a hotkey via <rich:hotKey key="return" ... /> It works great everywhere except in the combobox, and I would really like to get it working on the combobox as well. The behaviour I want when the ENTER key is pressed inside the combobox is: If the combobox context was modified by auto complete then do nothing Else action the event on ENTER key pressed We're running on seam/richfaces. I'm open to any workaround, but simplicity is much sought for. Thanks!

    Read the article

  • Odd visual issue with ListView item layout with two pressable pieces

    - by jnylen
    I wanted to make a ListView where the items have two pressable pieces, like the layouts that show up in a couple of places in the stock Android phone/contacts application: I have the layout working fine, including handling events from each piece separately, except for a visual issue when the smaller piece is pressed. In my application the smaller piece only gets a small ellipse for the background when it is pressed, like this: Note that is actually not my application - that is NubDial, but my application has the same problem. Since NubDial uses the exact same XML layout as the phone app, I'm not sure how relevant the list item layouts are, but here they are anyway: Contacts list: contacts_list_item.xml NubDial: contacts_list_item.xml Does anybody know what might be happening there?

    Read the article

  • How to prevent modal view controllers flashing when changing

    - by KP Overflow
    I have three view controllers, let's call them A, B and C. When a button is pressed on view A, view B is shown using presentModalViewController:animated: When the finish button is pressed on screen B, it dismisses itself. View A is notified whereupon it immediately shows view C, again using presentModalViewController:animated: The problem is that view A's content is momentarily flashed on the screen between view B closing and view C opening. I can get around this by making view A blank and moving it's current content to a new view, D. (For various reasons, I don't want view B to own view C, that's why it's not opening it) Am I over-complicating this? I'm sure there is a smarter way to go? ThanksT

    Read the article

  • Generating Mouse-Keyboard combination events in python

    - by freakazo
    I want to be able to do a combination of keypresses and mouseclicks simultaneously, as in for example Control+LeftClick At the moment I am able to do Control and then a left click with the following code: import win32com, win32api, win32con def CopyBox( x, y): time.sleep(.2) wsh = win32com.client.Dispatch("WScript.Shell") wsh.SendKeys("^") win32api.SetCursorPos((x,y)) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y, 0, 0) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y, 0, 0) What this does is press control on the keyboard, then it clicks. I need it to keep the controll pressed longer and return while it's still pressed to continue running the code. Is there a maybe lower level way of saying press the key and then later in the code tell it to lift up the key such as like what the mouse is doing?

    Read the article

  • How to animate a UIButton selected background Image

    - by Thomas Joos
    hi all, I have a class defining a custom UIButton. I configurate a normal and selected state like this: //custom image UIImage *image = [UIImage imageNamed:@"customIconCreationBG.png"]; UIImage *stretchImage = [image stretchableImageWithLeftCapWidth:0.0 topCapHeight:0.0]; [self setBackgroundImage:stretchImage forState:UIControlStateNormal]; UIImage *imageSelected = [UIImage imageNamed:@"customIconCreationBG_selected.png"]; UIImage *stretchImageSelected = [imageSelected stretchableImageWithLeftCapWidth:0.0 topCapHeight:0.0]; [self setBackgroundImage:stretchImageSelected forState:UIControlStateSelected]; In another class I'm filling an array with custom buttons and i'm adding a button pressed method. It sets the selected state to TRUE -(void)buttnPressed:(id)sender { NSLog(@"button pressed"); [[NSNotificationCenter defaultCenter] postNotificationName:@"unselectBGIcons" object:self]; HorizontalListIcon *pressedIcon = ((HorizontalListIcon *)sender); [pressedIcon setSelected:TRUE]; } The button switches to another background, which is great. Is there a way to animate this change ( fading in? ) because it's a bit hard now. Greets

    Read the article

  • How do I close a form when the ESC key was hit, but only if no Control handled it?

    - by Gabriel
    I have a Form that closes itself when the ESC key is pressed, thanks to KeyPreview, ProcessKeyEventArgs, ProcessCmdKey or whatever. But I have a Control on that form that does very relevant things when ESC is pressed (it hides itself) and the Form should not be closed when that happens. The control uses the KeyDown event and sets the SuppressKeyPress flag to true, but that happens after the aforementioned form key preview, thus having no effect. Is there some sort KeyPostview ? How do I not close the form when a Control has a relevant use of a key hit ? Edit: The control handling ESC is a textbox embedded in a hand-maid ListView. The textbox appears when the user clicks a cell, enabling edition. To validate the new text, ENTER would be nice (that already works, as giving the focus to anything else). To cancel edition, ESC seems most natural.

    Read the article

  • Create controls dynamically

    - by Afnan
    I want to know if this is possible in c# winform. create control when ever button is pressed and place it at given location. I think it is possible like this private TextBox txtBox = new TextBox(); private Button btnAdd = new Button(); private ListBox lstBox = new ListBox(); private CheckBox chkBox = new CheckBox(); private Label lblCount = new Label(); but the problem lies when ever button is pressed same name controls are created.How to avoid that

    Read the article

  • Do you have to create a View Controller to move between views?

    - by Frames84
    I want a single startup view with a button and a welcome screen. When the button is pressed I then want to navigate to a second view which contains a table view and toolbar. I've tried creating a ViewController but my button is shown on all views. I just want a single view, then when it's pressed i go to the next view and the 'real' app starts. Can someone please try and explain the best architecture to do this? (like in chapter 6 of beginning iPhone 3 Development by Dave Mark and Jeff LaMarche ) Thanks

    Read the article

  • Trigger button click with JavaScript on Enter key in Text Box

    - by ziondreams
    I have one text input and one button (see below). How can I use JavaScript to trigger the button's click event when the Enter key is pressed inside the text box? There is already a different submit button on my current page, so I can't simply make the button a submit button. And, I only want the enter key to click this specific button if it is pressed from within this one text box, nothing else. <input type="text" id="txtSearch" /> <input type="button" id="btnSearch" value="Search" onclick="doSomething();" /> Update: I'd like to accept my own answer below, but since that is now allowed I will accept the next best solution.

    Read the article

  • Can't get flat QToolButton with border on hover stylesheet

    - by Max
    Hi, all! I need to implement textbox with inplace button (for search or filter purposes). So, I need to get Qtoolbutton, that is flat and rendered as icon, and obtain the border when hovered by mouse or pressed. And maybe I'd add some almost transparent background on hover too. I tried to set the following stylesheet: 'border: none; hover {border: 1px} pressed {border: 1px}' , but it seems that only border set. I tried to set autoRaise() to True and False, I mean, maybe some intersection occured, but haven't succeed.

    Read the article

  • Finding out event that called a CGI script

    - by Acorn
    What I want is to be able to make my CGI script do different things depending on what action initiated the calling of the script. For example, if one button is pressed, a database is cleared. If another button is pressed, a form is submitted and that data is added to the database. Should I be doing something like adding the name of the form/button to the end of the POST data submitted in jQuery and then .poping it off in the script? Or is there some other data that's already sent in the POST that I could get from FieldStorage that would give me the information I need to decide what the script should do when it's called? And what if I wasn't using javascript? Would I have to have a hidden field that gets submitted with the name of the form/button? Or is it best to use a different target script for each button on a page?

    Read the article

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