(CB) setAction isn't working for me
In my new() method for MyWindowController.pm, I have the code: $self-{'Browser_F'}-setAction('browserFSgl:'); Lower down in the file, I have the code: sub browserFSgl { my ($self, $browser) = @_; NSLog(browserFSgl); return($self); } If this were doing what I expect, it would print browserFSgl on the log every time I clicked a line in the named NSBrowser. Can anyone tell me why it doesn't? -r P.S. The rest of my browser now seems to be working just fine. I'm just using this as a way to get the selected pathname. -- email: [EMAIL PROTECTED]; phone: +1 650-873-7841 http://www.cfcl.com/rdm- my home page, resume, etc. http://www.cfcl.com/Meta - The FreeBSD Browser, Meta Project, etc. http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series http://www.ptf.com/tdc - Prime Time Freeware's Darwin Collection
Re: (CB) setAction isn't working for me
In my new() method for MyWindowController.pm, I have the code: $self-{'Browser_F'}-setAction('browserFSgl:'); - (void)setAction:(SEL)aSelector Yes, this is not working for me either. Is CamelBones currently supporting SEL (selectors) at all ? I ran into a similar problem when trying to make a dynamic dock menu. Rich, is there any error message you get when calling setAction? You call it with a string, I tried to call it with a SEL (which failed because I could not create a selector). I also got error messages when calling functions that _return_ SEL. Anyone succeeded in doing these things ? Thilo
Soap::Lite basic authentication
I have protected folder skyris using http access. For some reason the client bypasses the protection and can access the folder directly !!! Which means I can run any script though I have protected that folder with http access. When I try accessing the folder using browser it asks for authentication !! So the problem exists only when accessing from the client code. Is there any configuration(say http.conf) that I need to do while on the server for SOAP::Lite for authentication ? My Client code is #!/usr/bin/perl use SOAP::Lite +autodispatch = uri = 'http://optimistix.liqwidkrystal.com/Demo', proxy = 'https://optimistix.liqwidkrystal.com/skyris/hibye.cgi', on_fault = sub { my($soap, $res) = @_; die ref $res ? $res-faultstring : $soap-transport- status, \n; } ; print hi(); --- If I replace the uri and proxy with something like this - #!/usr/bin/perl use SOAP::Lite +autodispatch = uri = 'http://www.soaplite.com/My/Examples', proxy = 'http://services.soaplite.com/auth/examples.cgi', on_fault = sub { my($soap, $res) = @_; die ref $res ? $res-faultstring : $soap-transport- status, \n; } ; print getStateName(21); I get a 401 authentication error which is as expected. So why is my code(case 1) not giving the same error ?? thanks in advance, ashwinee kumar
Re: (CB) setAction isn't working for me
On Wednesday, February 12, 2003, at 04:04 AM, Thilo Planz wrote: In my new() method for MyWindowController.pm, I have the code: $self-{'Browser_F'}-setAction('browserFSgl:'); - (void)setAction:(SEL)aSelector Is CamelBones currently supporting SEL (selectors) at all ? Yes, it does - they're passed as strings - Rich is doing that correctly. Take a look at the file ShuXWindowController.pm in ShuX. Rich, two questions about your code: 1. Are you exporting the correct method signature for your browserFSgl: method? By default, methods are declared to the ObjC runtime as taking a single object parameter, and returning an object. The default arguments are OK, so you'd only need to specify the return type, like this: $OBJC_EXPORT{'browserFSgl:'} = { 'return' = 'v', }; 2. Are you also using setTarget: to tell the browser to what object it should send the action message? sherm-- If you listen to a UNIX shell, can you hear the C?
Re: (CB) setAction isn't working for me
At 7:22 AM -0500 2/12/03, Sherm Pendley wrote: On Wednesday, February 12, 2003, at 04:04 AM, Thilo Planz wrote: In my new() method for MyWindowController.pm, I have the code: $self-{'Browser_F'}-setAction('browserFSgl:'); - (void)setAction:(SEL)aSelector Is CamelBones currently supporting SEL (selectors) at all ? Yes, it does - they're passed as strings - Rich is doing that correctly. Take a look at the file ShuXWindowController.pm in ShuX. And the really cool thing is that if the target object is otherwise specified you don't have to do much. (As I found out when the timer stuff just up and worked for me :) -- Dan --it's like this--- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk
(CB) Notification confusion
I have my browser's plumbing working, but I found myself doing some peculiar things. I'm hoping that one of you can tell me wazzup. The new() method (in MyWindowController.pm) sets up Browser_F (an NSBrowser) and TextField_F (an NSTextField): # Set up TextField_F's notification jazz. # Found. Classes NSNotificationCenter Class Methods # + defaultCenter # $dnc = NSNotificationCenter-defaultCenter(); # Found. Classes NSNotificationCenter Instance Methods # - addObserver:selector:name:object: # $dnc-addObserver_selector_name_object( $self, 'controlTextDidEndEditing:', 'NSControlTextDidEndEditingNotification', undef); # Set the initial path into TextField_F and Browser_F. # AppKit Classes NSCell Instance Methods # setStringValue: # $self-{'TextField_F'}-setStringValue($curr_path); # AppKit Classes NSBrowser Instance Methods # setPath: # $self-{'Browser_F'}-setPath($curr_path); # Set up a method to accept single-click events from Browser_F. # AppKit Classes NSControl Instance Methods # setTarget: # $self-{'Browser_F'}-setTarget($self); # AppKit Classes NSControl Instance Methods # setAction: # $self-{'Browser_F'}-setAction('browserFSgl:'); When a single click is detected by Browser_F, browserFSgl() picks up the path from Browser_F, sets the value of TextField_F, and posts a notification that TextField_F has finished editing: # browserFSgl - handle single-click event in browser $OBJC_EXPORT{'browserFSgl:'} = { 'args' = '@', 'return' = 'v' }; sub browserFSgl { my ($self, $browser) = @_; my ($path); # AppKit Classes NSBrowser Instance Methods # path # $path = $browser-path(); $path = '/' if ($path eq ''); # AppKit Classes NSCell Instance Methods # setStringValue: # $self-{'TextField_F'}-setStringValue($path); # Found. Classes NSNotificationCenter Instance Methods # postNotificationName:object: # $dnc-postNotificationName_object( 'NSControlTextDidEndEditingNotification', $self-{'TextField_F'}); return($self); } When the notification arrives, controlTextDidEndEditing() picks up the new_path and compares it with the curr_path. It does this because it's getting called into action when I click on an item in Browser_F (before browserFSgl() gets called!). If the path is truly new, it updates other parts of the window, then sets the path for Browser_F (this event _could_ have come from TextField_F, after all :-). sub controlTextDidEndEditing { my ($self, $aNotification) = @_; my ($name, $new_path, $tableView); # AppKit Classes NSCell Instance Methods # stringValue # $new_path = $aNotification-object()-stringValue(); # KLUDGE - why are we being called when nothing has changed? $new_path =~ s|^.*\n||; if ($new_path eq $curr_path) { return($self); } $curr_path = $new_path; ... # AppKit Classes NSBrowser Instance Methods # setPath: # $self-{'Browser_F'}-setPath($curr_path); return($self); } -- email: [EMAIL PROTECTED]; phone: +1 650-873-7841 http://www.cfcl.com/rdm- my home page, resume, etc. http://www.cfcl.com/Meta - The FreeBSD Browser, Meta Project, etc. http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series http://www.ptf.com/tdc - Prime Time Freeware's Darwin Collection
konfabulator -- something to ponder
Some time in early 2000 Arlo Rose came up with an idea for a cool little application. It would use XML to structure images, and a scriptable language, like Perl, in such a way that someone who knew the basics of Perl could put together cool little mini-applications. The goal was that these mini-applications would just sit around on your desktop looking pretty, while providing useful feedback. All he ever really wanted was to have a cool looking battery monitor and something that told him the weather, but he knew the possibilities for something like this could potentially be limitless. Fast forward a couple of years when Arlo began working with Perry Clarke at Sun Microsystems. Over lunch one afternoon Arlo gave Perry the basics of this dream app. Perry suggested that JavaScript would be far easier for people to digest. He was right. It's the basis for Flash's ActionScript, and Adobe's scripting engine for Photoshop. Of all the choices, JavaScript made the most sense. Shortly after that lunch, the two began to spend their nights and weekends making this thing a reality. A half year later Konfabulator is ready for download, and now it's up to you to see if they were right about how cool this thing can be! Shux, I just wish this had been Perl... For those who haven't seen it, Konfabulator just brings a smile to my face. It is what sets a Mac apart from any other computer platform. Puneet.
Re: konfabulator -- something to ponder
On Wed, 12 Feb 2003, Puneet Kishor wrote: Some time in early 2000 Arlo Rose came up with an idea for a cool little application. It would use XML to structure images, and a scriptable language, like Perl, in such a way that someone who knew the basics of Perl could put together cool little mini-applications. The goal was that these mini-applications would just sit around on your desktop looking pretty, while providing useful feedback. [] A half year later Konfabulator is ready for download, and now it's up to you to see if they were right about how cool this thing can be! Shux, I just wish this had been Perl... :) Funny, a cow-orker was just telling me about this this evening. Is the material above taken from http://www.konfabulator.com/? If it's from an article somewhere, can you cite the source? For those who haven't seen it, Konfabulator just brings a smile to my face. It is what sets a Mac apart from any other computer platform. I'm still not sure I get it. Hrm... http://kmirror.deskmod.com/info/ Ahh, there's your quote on this page :) Ahh, it was written by one of the Kaleidoscope people. Ok, so it's going to have cheesy over the top skinz before too long. But anyway, I'm not sure I see the point. It seems interesting -- I'm just going by the web page at the moment, the download is reeeallly slow -- but I'm not sure if I want this kind of info sitting in a new interface widget in addition to the dock menubar, which already claim a good deal of screen real estate. Most of the sample widgets I've seen, I'd rather seo them available as menubar widgets instead. I dunno, this is slick, but I'm still underwhelmed for some reason. Maybe it's my deep-seated aversion to software skins related wacky interface shenanigans that usually comes up with such software (mp3 players, etc). Fun if you used to use Kaleidascope or (in x11) enlightenment though. If you're into that sort of thing :) -- Chris Devers[EMAIL PROTECTED] semiotics, n. Half a science of meaning is better than none. See also TEXTUAL HARRASSMENT. -- from _The Computer Contradictionary_, Stan Kelly-Bootle, 1995
Re: konfabulator -- something to ponder
Puneet Kishor wrote: Some time in early 2000 Arlo Rose came up with an idea for a cool little application. It would use XML to structure images, and a scriptable language, like Perl, in such a way that someone who knew the basics of Perl could put together cool little mini-applications. The goal was that these mini-applications would just sit around on your desktop looking pretty, while providing useful feedback. All he ever really wanted was to have a cool looking battery monitor and something that told him the weather, but he knew the possibilities for something like this could potentially be limitless. Fast forward a couple of years when Arlo began working with Perry Clarke at Sun Microsystems. Over lunch one afternoon Arlo gave Perry the basics of this dream app. Perry suggested that JavaScript would be far easier for people to digest. He was right. It's the basis for Flash's ActionScript, and Adobe's scripting engine for Photoshop. Of all the choices, JavaScript made the most sense. Shortly after that lunch, the two began to spend their nights and weekends making this thing a reality. A half year later Konfabulator is ready for download, and now it's up to you to see if they were right about how cool this thing can be! http://gkrellm.net anyone ;-) (granted it isn't javascript) ...sorry that must be my linux background showing through again...back in the cage you nasty little penguin http://danconia.org
Re: konfabulator -- something to ponder
On Wednesday, February 12, 2003, at 08:41 PM, Chris Devers wrote: On Wed, 12 Feb 2003, Puneet Kishor wrote: Some time in early 2000 Arlo Rose came up with an idea for a cool little application. It would use XML to structure images, and a scriptable language, like Perl, in such a way that someone who knew the basics of Perl could put together cool little mini-applications. The goal was that these mini-applications would just sit around on your desktop looking pretty, while providing useful feedback. [] A half year later Konfabulator is ready for download, and now it's up to you to see if they were right about how cool this thing can be! Shux, I just wish this had been Perl... :) Funny, a cow-orker was just telling me about this this evening. Is the material above taken from http://www.konfabulator.com/? yes. .. Ahh, it was written by one of the Kaleidoscope people. Ok, so it's going to have cheesy over the top skinz before too long. But anyway, I'm not sure I see the point. It seems interesting -- I'm just going by the web page at the moment, the download is reeeallly slow -- but I'm not sure if I want this kind of info sitting in a new interface widget in addition to the dock menubar, which already claim a good deal of screen real estate. Most of the sample widgets I've seen, I'd rather seo them available as menubar widgets instead. I dunno, this is slick, but I'm still underwhelmed for some reason. Maybe it's my deep-seated aversion to software skins related wacky interface shenanigans that usually comes up with such software (mp3 players, etc). well, don't go by the skinnability of it... that, in some minds, might invoke visions of zit-heavy teenagers figuring out how to make their mp3 player look like saruman's eyes. Instead, look at it this way... a hypercard without stacks, without borders... an aqua app that floats on your desktop... self-contained (well, actually the widgets require konfabulator in order to run, so it is not really that stand-alone, but the effect is)... think of it as a browser without really being a browser. with a real (some may question that, but that is not important), well-developed programming language. Javascript is actually a very nice language... it just requires a browser to be able to run, which kinda sucks. Well, konfab removes that restriction. Make your widget, and get it to download stocks, show the weather... you know, it is difficult to describe. But when you see it, you really shake your head in wonder. Kinda like what Spring is (have you seen Spring... another innovative application the kinds of which only seem possible on OS X... it is stuff like Konfabulator, Spring, Launchbar, Watson, and hopefully one day soon Camelbones, that make using computers worthwhile). Only, more capable. Fun if you used to use Kaleidascope or (in x11) enlightenment though. If you're into that sort of thing :) you make it sound dirty. ;-)
Re: konfabulator -- something to ponder
Most of the sample widgets I've seen, I'd rather seo them available as menubar widgets instead. Come on Chris - that's a bit like dismissing something just because there's only a poxy hello world example, and why on earth would anyone just want to print hello world? I dunno, this is slick, but I'm still underwhelmed for some reason. Maybe it's my deep-seated aversion to software skins related wacky interface shenanigans that usually comes up with such software (mp3 players, etc). But it's not skins. It's a way to create guis for little gobbets of functionality. Yes there's the script menu, the BigCat contextual script menu (Brent Simmon's more important bit of code ;), LaunchBar, DragThing, YoupiKey, QuicKey, KeyQuencer, ScriptGui, ShellShell and others which allow you to trigger scripts but none of them offer much by way of returning info to the user and none of them (DragThing half-excepted) let you create your own interface to work with. Oh, not forgetting AppleScriptStudio, but well, hmmm. Konfabulator is not just Kaleidoscope. What it is most like is Prefab Player or WestCodeSoft's OneClick http://www.westcodesoft.com/oneclick/ (quite simply the finest scripting productivity tool ever). Of course, Konfabulator doesn't allow users to simply (and robustly) record actions like OneClick did, nor does it offer a built-in widget to allow gui-based construction of further widgets - but they're working on that last bit. Although it doesn't appear to have any OSA hooks, you can invoke shell commmands which return strings, so you could fire off perl from your widgets [frantic attempt to bring things on topic] Not that I've been able to actually use it (despite asking to beta it since last September) cos I'm still on 10.1.5.
Re: konfabulator -- something to ponder
think of it as a browser without really being a browser. hmmm. that's not really very useful. What if you just create a palette of buttons for actions to perform? Is that really a browser in any sense at all? Or is Photoshop a browser that you only use to manipulate images in? ;) Javascript is actually a very nice language... it just requires a browser to be able to run, which kinda sucks. Well, konfab removes that restriction. I like Javascript too. But you don't need Konfabulator to run it on OSX outside a browser http://www.latenightsw.com/freeware/JavaScriptOSA/index.html But, yes, I agree with your basic points about the beauty/innovative coolness of OSX
Re: (CB) Notification confusion
On Wednesday, February 12, 2003, at 06:41 PM, Rich Morin wrote: # Set up a method to accept single-click events from Browser_F. I suppose this works, but it's more work than it should be. It's much easier to connect actions to their targets in Interface Builder - that's what it's there for. When a single click is detected by Browser_F, browserFSgl() picks up the path from Browser_F, sets the value of TextField_F, and posts a notification that TextField_F has finished editing: That's not what NSControlTextDidEndEditingNotification is intended for. It's not a notification that you should fire yourself. It's fired by the text field object, to notify interested observers that the *user* has edited - although not necessarily changed - the contents of the field. There's nothing wrong with firing off your own notifications, of course; it's just that, if you want to do that, you should give them unique names that don't overlap those of notifications already in use. When the notification arrives, controlTextDidEndEditing() picks up the new_path and compares it with the curr_path. It does this because it's getting called into action when I click on an item in Browser_F (before browserFSgl() gets called!). You're receiving the notification before browserFSgl() gets called, because the notification is fired by the text field *automatically*, whenever an editing session finishes - regardless of whether the session resulting in changes being made to the text. Looking at your code, it's not apparent why you're calling controlTextDidEndEditing() (indirectly, via a notification) when the event you're responding to is, in fact, a click in on a browser cell. Those are two distinct events, and they should be handled as such - otherwise, as you've pointed out, the code starts looking rather peculiar. It looks like what you want is two methods. One is an action method that's called in response to clicks on a browser cell, and the other is a delegate method that's called by the text field at the end of an editing session. In each method, the new path found in the object that generated the event needs to be supplied to the other object. Both of these methods are called directly by the GUI; neither should call the other. # KLUDGE - why are we being called when nothing has changed? Because you asked to be notified whenever the editing session ends - that doesn't always mean that the text has actually changed. If you want to be notified whenever the text has changed, you want to register to receive NSControlTextDidChangeNotification instead. Fair warning: If I recall correctly, this notification is fired for every single change - meaning for each character typed. That can be useful if it's what you really want; for example, you could provide live updates to the browser as the user is typing. But if all you want is to update the browser when the user is finished making changes, and either presses enter or moves to another control, it's less useful. sherm-- I have no special gift, I am only passionately curious. - Albert Einstein
Re: konfabulator -- something to ponder
On Wednesday, February 12, 2003, at 09:28 PM, Alex Robinson wrote: think of it as a browser without really being a browser. hmmm. that's not really very useful. What if you just create a palette of buttons for actions to perform? well, a browser with nothing but form buttons on it with js code attached is a [sic] palette of buttons for actions to perform. Such a palette with no rectangular borders, and a richer (than just js) language combo of js+xml kinda completes the description for Konfab widgets. I was just trying desperately to think of metaphors to explain Konfab. ;-) I personally hope Arlo/Perry separate the dependence on js, so I could use perl... at some level most of these languages do pretty much the same thing. I just want to do them in perl, if possible.
Re: konfabulator -- something to ponder
On Wednesday, February 12, 2003, at 09:28 PM, Joel Rees wrote: Shux, I just wish this had been Perl... So, is this konfabulator thingy going to have some advantage over, say, Tk with Perl? (Or RealBASIC, or Borland's Java gadget, except that those are not free?) unfortunately I don't know enough about Tk+Perl, RB, and Java to comment on this intelligently. I just happen to understand js better than these languages (except for Perl)... and for most part, I find stuff made in Tk, RB, and Java to be ugly. But, that might be because of the desginers of those stuffs rather than the language itself (although, swing and awt are pretty crappy to look at)
advanced stdout/stderr capturing?
I want to be able to write a perl script that does advanced logging of both itself and the system() calls it makes. One of my desired goals is to replace STDERR and STDOUT in such a way that 1) the command line user still sees them both, and as they are output (not strangely buffered) 2) I have a log of every snippit of STDERR and STDOUT with the time (in granularity more fine than seconds, if possible) it arrived and in the order that it was received. e.g. if I had something like $| = 1; print STDERR Why don't you; print STDOUT eat my; print STDERR shorts?\n; I might end up with something like [ { type = 'STDERR', time = 1, text = Why don't you }, { type = 'STDOUT', time = 1.0001, text = eat my }, { type = 'STDERR', time = 1.0002, text = shorts?\n }] in memory somewhere... Is there something out there that already does this? Or does it on arbitrary numbers of filehandles/io::handles? Thanks in advance, nh
Re: (CB) Notification confusion
On Wednesday, February 12, 2003, at 06:41 PM, Rich Morin wrote: I have my browser's plumbing working, but I found myself doing some peculiar things. I'm hoping that one of you can tell me wazzup. I've put together a sample app showing how to use NSBrowser with CB. A few notes about it: It's fully keyboard-navigable - i.e. you can tab between the text field and the browser - if you turn on Full Keyboard Access under the keyboard pane in System Preferences. When you're typing in the path text field, updates to the browser are live - that is, the browser selection is updated to reflect your typing with every keystroke. Likewise, the text field is updated with every change in browser selection. Everything that could be done in Interface Builder, was. Thus, you'll see no setTarget(), setAction(), or setDelegate() calls. Delegation is used rather than notifications. A bare minimum of information - the filename and owner - is displayed about the selected file/folder - I had to leave *something* for Rich to do, after all. I wouldn't want him to get bored. ;-) This example will be included in the next version of CB. Until then, you can download it from my site: http://www.dot-app.org/BrowserSample.tgz sherm-- C programmers never die - they're just cast into void.
Fink sets PERL5LIB
If you use Fink to install something that has a Perl module component, Fink's /sw/bin/init.csh will set the PERL5LIB environment variable when you next log in. This screws with @INC if you have your own Perl installed--you'll see Dylib messages everything you try to do something that involves a Perl module with an XS component. The easiest fix is to specifically unset PERL5LIB in your .cshrc after the sourcing: source /sw/bin/init.csh unsetenv PERL5LIB This is probably what messed with my head last week. Nat