Search Results

Search found 28345 results on 1134 pages for 'custom event'.

Page 151/1134 | < Previous Page | 147 148 149 150 151 152 153 154 155 156 157 158  | Next Page >

  • wxPython, Threads, and PostEvent between modules

    - by Sam Starling
    I'm relatively new to wxPython (but not Python itself), so forgive me if I've missed something here. I'm writing a GUI application, which at a very basic level consists of "Start" and "Stop" buttons that start and stop a thread. This thread is an infinite loop, which only ends when the thread is stopped. The loop generates messages, which at the moment are just output using print. The GUI class and the infinite loop (using threading.Thread as a subclass) are held in separate files. What is the best way to get the thread to push an update to something like a TextCtrl in the GUI? I've been playing around with PostEvent and Queue, but without much luck. Here's some bare bones code, with portions removed to keep it concise: main_frame.py import wx from loop import Loop class MainFrame(wx.Frame): def __init__(self, parent, title): # Initialise and show GUI # Add two buttons, btnStart and btnStop # Bind the two buttons to the following two methods self.threads = [] def onStart(self): x = Loop() x.start() self.threads.append(x) def onStop(self): for t in self.threads: t.stop() loop.py class Loop(threading.Thread): def __init__(self): self._stop = threading.Event() def run(self): while not self._stop.isSet(): print datetime.date.today() def stop(self): self._stop.set() I did, at one point, have it working by having the classes in the same file by using wx.lib.newevent.NewEvent() along these lines. If anyone could point me in the right direction, that'd be much appreciated.

    Read the article

  • Dell PERC 5 - RAID-10 keeps rebuilding drive 2 every day

    - by raid question
    I have a Dell PowerEdge 2950 with this card: RAID bus controller [0104]: Dell PowerEdge Expandable RAID controller 5 [1028:0015] and six disks in a RAID-10. I replaced drive 2, because it didn't show up, and then it started to rebuild itself: root@backup01:~# megaraidsas-status -- Arrays informations -- -- ID | Type | Size | Status a0d0 | RAID 10 | 5587GiB | DEGRADED -- Disks informations -- ID | Model | Status | Warnings a0e8s0 | ATA ST2000DM001-9YN1 1863GiB | online | errs: media:0 other:5393 a0e8s1 | ATA ST2000DM001-9YN1 1863GiB | online | errs: media:0 other:5394 a0e8s2 | ATA ST2000DM001-1E61 1863GiB | rebuild | errs: media:0 other:99 a0e8s3 | ATA ST2000DM001-9YN1 1863GiB | online | errs: media:0 other:5393 a0e8s4 | ATA ST2000DM001-9YN1 1863GiB | online | errs: media:0 other:5393 a0e8s5 | ATA ST2000DM001-9YN1 1863GiB | online | errs: media:0 other:5393 The rebuild finishes, then the virtual drive becomes optimal, and drive 2 goes online. Then once a day, drive 2 acts like it's been removed, and the rebuild starts all over again. How do I make this once a day rebuild stop? Event Description: Removed: PD 02(e1/s2) Event Description: Removed: PD 02(e1/s2) Info: enclPd=08, scsiType=0, portMap=04, sasAddr=1221000002000000,0000000000000000 Event Description: State change on VD 00/0 from OPTIMAL(3) to DEGRADED(2) Event Description: VD 00/0 is now DEGRADED1 Event Description: State change on PD 02(e1/s2) from ONLINE(18) to FAILED(11) Event Description: State change on PD 02(e1/s2) from FAILED(11) to UNCONFIGURED_BAD(1) Event Description: Background Initialization failed on VD 00/0 Event Description: Inserted: PD 02(e1/s2) Event Description: Inserted: PD 02(e1/s2) Info: enclPd=08, scsiType=0, portMap=04, sasAddr=1221000002000000,0000000000000000 Event Description: PD 02(e1/s2) is not a certified drive Event Description: State change on PD 02(e1/s2) Event Description: State change on PD 02(e1/s2) from UNCONFIGURED_GOOD(0) to OFFLINE(10) from UNCONFIGURED_BAD(1) to UNCONFIGURED_GOOD(0) Event Description: Rebuild automatically started on PD 02(e1/s2) Event Description: State change on PD 02(e1/s2) from OFFLINE(10) to REBUILD(14)

    Read the article

  • Qt creator, insert custom menu at specified place into menu bar

    - by user363778
    Hi, I have created a menu bar and some menus with Qt creator. One of the menus had to be coded to use QActionGroup features. Now it is easy to add my custom menu to the menu bar with: printMenu = menuBar()-addMenu(tr("&Print")); but my menu will be in the last position of the menu bar. How do I add my menu at a specified place? (e.g. the second place right after the File menu) Greetings

    Read the article

  • OpenLayers: Raise event when map is zoomed or moved by user

    - by David Pfeffer
    I'm using OpenLayers to display OpenStreetMap maps. (Though, I'd assume this should be general enough to work for any map product...) I'm displaying some very sophisticated vector overlays, and the amount and resolution of the features I'm returning from the server via GeoJSON to overlay has proven too much for many computers. What I'd like to do now instead is to only send data befitting the resolution of the current zoom, and fitting the current view port. This should be relatively easy to do using the GetResolution and CalculateBounds methods on the Map object. However, I don't know when to call these methods because I can't find a way to register a function to be called when the user pans the map (changing the view port) or zooms the map (changing the resolution and view port). How can I get a callback when the user pans or zooms the map?

    Read the article

  • Display custom file format's metadata in Windows Explorer

    - by Benny Jobigan
    When viewing a jpg or mp3 in Windows Explorer, the bottom pane shows metadata from the media file. Furthermore, for video and picture, the icon is shown as a preview of the media. Is there a way to add this kind of functionality to windows for custom file types that aren't supported by default in windows? Is there a certain sort of plugin or extension that must be written? If so, how is it implemented? Thank you.

    Read the article

  • Custom Task Queue in App Engine?

    - by demos
    I have created a new task queue and defined it in queue.yaml I am not sure how to start adding tasks to this queue? with the default queue it is simple taskqueue.add(...) how do we do it for a custom queue?

    Read the article

  • QT: custom widget in QScrollArea

    - by slimscsi
    I am attempting to create a custom widget. My Widget renders itself unless it is inside a scroll area. The code below works. If I change the if(0) to an if(1) inside the MainWindow constructor, it will not render the "Hello World" string. I assume that I must (re)implement some additional methods, but so far I have not been able to find the correct ones with trial and error. // hellowidget.h #ifndef HELLOWIDGET_H #define HELLOWIDGET_H #include <QtGui> class HelloWidget : public QWidget { Q_OBJECT public: HelloWidget(QWidget *parent = 0); void paintEvent(QPaintEvent *event); }; #endif // HELLOWIDGET_H // hellowidget.cpp #include "hellowidget.h" HelloWidget::HelloWidget(QWidget *parent) : QWidget(parent) { } void HelloWidget::paintEvent(QPaintEvent *event) { QPainter painter(this); painter.drawText(rect(), Qt::AlignCenter, "Hello World"); } // mainwindow.h #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QtGui> class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget *parent = 0); ~MainWindow(); private: }; #endif // MAINWINDOW_H // mainwindow.cpp #include "mainwindow.h" #include "hellowidget.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { HelloWidget *hello = new HelloWidget; QWidget *central = hello; if( 0 ) { QScrollArea *scroll = new QScrollArea ; scroll->setWidget(hello); central = scroll; } setCentralWidget( central ); } MainWindow::~MainWindow() { } // main.cpp #include <QtGui/QApplication> #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); }

    Read the article

  • Placing custom code in a System namespace

    - by David Brown
    Are there any best-practices that state custom code shouldn't be placed in a System namespace? Should System and its children be reserved for Microsoft code? I ask because I'm writing a class library that will be used across many projects and I'd like to keep things consistent by placing it in System.InteropServices (since it deals with P/Invoke).

    Read the article

  • Indexing Service: getting empty columns on custom properties

    - by itchi
    I'm following this example: http://www.codinghorror.com/blog/2005/12/getting-started-with-indexing-service.html However, the conversion to dataset shows empty columns for my custom properties. If I use path or filename for the columns I get data back. I have set the properties to be cached, have tried both levels, and have rescanned full. I've tried this example on my desktop (windows vista 32bit) and on a Windows 2008 R2 server with the same results.

    Read the article

  • JavaScript question -- onMouseOver event

    - by alex_wang
    Why doesn't this piece of code swap images on mouse-over as intended?: <a href="#" onMouseOver=" if (document.the_image.src == '01.jpg') { document.the_image.src = '02.jpg'; } else if (document.the_image.src == '02.jpg') { document.the_image.src = '03.jpg'; } else { document.the_image.src = '01.jpg'; } "> Some image</a><br>

    Read the article

  • Selenium IDE and custom confirm() function conflict

    - by sakhunzai
    I am using simple modal dialog by Eric Martin. And have defined a function e.g function confirm(message, options) {.... } To customize all confirm dialogs. Its working nicely accross all the browsers.Except when I enable Selenium IDE ,my custom confirm dialog function fails to capture "options" parameters and firefox console echos like this: options is undefined callback=options.callback; Error When Selenium IDE is visible Normal Behaviour When Selenium IDE is closed Please help me sort out this issue so I should able to run selenium tests.

    Read the article

  • LinkButton Click event ignored

    - by Craig
    I have the following Hyperlink as a button:- <asp:LinkButton ID="loginButton" runat="server" CssClass="loginButton" Text="LOGIN" OnClientClick="return validateLogin(memNoID,pwID)" AddressOf="loginButton.Click"></asp:LinkButton> It causes a postback but only executes the onload and prerender sections of code. It totally ignores the following function signature:- Protected Sub loginButton_Click(ByVal sender As Object, ByVal e As EventArgs) Some code End Sub Any pointers appreciated.

    Read the article

  • Actionscript image download open custom viewer

    - by Vish
    Hi Gurus, i am downloading tiff images from WAMP server using our Flex AIR client. Using the following code for that. public static function requestDownload(id:int, defaultName:String):void { //POST params var urlVars:URLVariables = new URLVariables(); urlVars.action = "download"; urlVars.fid = id; var urlReq:URLRequest = new URLRequest(); urlReq.url = Config.getServerURL(); urlReq.data = urlVars; Config.fileReference.addEventListener(Event.,FileDownload.requestDownloadResultV); try { Config.fileReference.download(urlReq, defaultName); } catch (e:Error) { Alert.show("Error in downloading the file"); } } public static function requestDownloadResultV(e:Event):void { Alert.show("File downloaded"); } No issues with the download. It automatically prompts for a Save dialog. Works well. But i want to open the image being downloaded in a viewer(flash viewer or any) instead of the save dialog. Please help me. Thanks Vish.

    Read the article

  • Objective C override %@ for custom objects

    - by nickcartwright
    Hey there, I'd like to override the default print function in NSLog for custom objects; For example: MyObject *myObject = [[MyObject alloc] init]; NSLog(@"This is my object: %@", myObjcet); Will print out: This is my object: <MyObject: 0x4324234> Is there a function I override in MyObject to print out a prettier description? Cheers! Nick.

    Read the article

  • How to disable listbox's click event

    - by StupidDeveloper
    I have a listbox which acts as a list of items. If you click on some item, it's contents are shown in the panel on the right (few textboxes etc.). I need to have a validation on these controls as all of them are required fields. And I do have it. The problem is that, even when the validators are not valid, user can click the listbox and change active index (that doesn't have impact on the panel on the right, as SelectedIndexChanged isn't fired). The validators are standard RequiredFieldValidator with their Display property set to "Dynamic". So, what I want is to disallow the user clicking on the listbox and changing the index untill all validators are Valid. What would be your solution for that? Is that even possible?

    Read the article

  • SharePoint 2010 Custom WCF Service - Windows and FBA Authentication

    - by e-rock
    I have SharePoint 2010 configured for Claims Based Authentication with both Windows and Forms Based Authentication (FBA) for external users. I also need to develop custom WCF Services. The issue is that I want Windows credentials passed into the WCF Service(s); however, I cannot seem to get the Windows credentials passed into the services. My custom WCF service appears to be using Anonymous authentication (which has to be enabled in IIS in order to display the FBA login screen). The example I have tried to follow is found at http://msdn.microsoft.com/en-us/library/ff521581.aspx. The WCF service gets deployed to _vti_bin (ISAPI folder). Here is the code for the .svc file <%@ ServiceHost Language="C#" Debug="true" Service="MyCompany.CustomerPortal.SharePoint.UI.ISAPI.MyCompany.Services.LibraryManagers.LibraryUploader, $SharePoint.Project.AssemblyFullName$" Factory="Microsoft.SharePoint.Client.Services.MultipleBaseAddressBasicHttpBindingServiceHostFactory, Microsoft.SharePoint.Client.ServerRuntime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" CodeBehind="LibraryUploader.svc.cs" %> Here is the code behind for the .svc file [ServiceContract] public interface ILibraryUploader { [OperationContract] string SiteName(); } [BasicHttpBindingServiceMetadataExchangeEndpoint] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)] public class LibraryUploader : ILibraryUploader { //just try to return site title right now… public string SiteName() { WindowsIdentity identity = ServiceSecurityContext.Current.WindowsIdentity; ClaimsIdentity claimsIdentity = new ClaimsIdentity(identity); return SPContext.Current.Web.Title; } } The WCF test client I have just to test it out (WPF app) uses the following code to call the WCF service... private void Button1Click(object sender, RoutedEventArgs e) { BasicHttpBinding binding = new BasicHttpBinding(); binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly; binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm; EndpointAddress endpoint = new EndpointAddress( "http://dev.portal.data-image.local/_vti_bin/MyCompany.Services/LibraryManagers/LibraryUploader.svc"); LibraryUploaderClient libraryUploader = new LibraryUploaderClient(binding, endpoint); libraryUploader.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation; MessageBox.Show(libraryUploader.SiteName()); } I am somewhat inexperienced with IIS security settings/configurations when it comes to Claims and trying to use both Windows and FBA. I am also inexperienced when it comes to WCF configurations for security. I usually develop internal biz apps and let Visual Studio decide what to use because security is rarely a concern.

    Read the article

  • flex: entering itemEditor when no value is assigned to data property in custom itemRenderer

    - by Markus
    Hi there, Im having a strange problem with my custom itemRenderer in the following Methode I assign the values to the cell. The problem is, when the side.element is still empty. In this case the itemEditor will not show up by default... override public function set data(side:Object):void{ super.data = side.element.toString(); choiceLabel.text = side.element.toString(); answer.selected = side.element.@answer; } Thanks for your help! Markus

    Read the article

  • AS3 httpservice - pass arguments to event handlers by reference

    - by Shawn Simon
    I have this code: var service:HTTPService = new HTTPService(); if (search.Location && search.Location.length > 0 && chkLocalSearch.selected) { service.url = 'http://ajax.googleapis.com/ajax/services/search/local'; service.request.q = search.Keyword; service.request.near = search.Location; } else { service.url = 'http://ajax.googleapis.com/ajax/services/search/web'; service.request.q = search.Keyword + " " + search.Location; } service.request.v = '1.0'; service.resultFormat = 'text'; service.addEventListener(ResultEvent.RESULT, onServerResponse); service.send(); I want to pass the search object to the result method (onServerResponse) but if I do it in a closure it gets passed by value. Is there anyway to do it by reference without searching through my array of search objects for the value returned in the result? Sorry, this is simple but it's been a long day...

    Read the article

  • PHP Doctrine: Custom nested set?

    - by ropstah
    Is it possible to have nested set capabilities in this somewhat custom setup? Consider these 4 tables: Object: (oid, name) contains: [1, 'Licence'] and [2, 'Exemption'] Licence: (lid, name) Exemption: (eid, name) Cost: (oid, oid_ref, cost_oid, cost_oid_ref) For: P = Licence with lid [1] R = Exemption with eid [2] i can say "object P is a parent to object R" if the following Cost record exists: [oid: 2 oid_ref: 2 cost_oid: 1 cost_oid_ref: 1] I understand that this creates somesort of 'conditional foreign key' relation which I need to define in code. Is it possible to have the nested set loaded with these conditions?

    Read the article

  • Custom Alert view

    - by Viral
    hi, I want to create a custom alert view, i.e. i want to put some images and my choice color on alert view, i know how to create normal alert view, but can any one help me out in this one??? so that the application will look pretty good. regard viral.

    Read the article

  • custom compare method in objective c

    - by Jonathan
    I'm trying to use a custom compare method (for use with sortedArrayusingSelector) and on another website I got that the format is: -(NSComparisonResult) orderByName:(id)otherobject { That's all bery well and good except how do I compare the otherObject to anything as there's only one thing passed to the method? Like how does the NSString method of compare: compare 2 strings when only one string is passed?

    Read the article

< Previous Page | 147 148 149 150 151 152 153 154 155 156 157 158  | Next Page >