logo       

Re: Windows and Camelbones: msg#00052

Subject: Re: Windows and Camelbones

On Aug 20, 2004, at 1:34 PM, Sherm Pendley wrote:

On Aug 20, 2004, at 3:31 PM, Alan Olsen wrote:

I am opening it as a modal dialog box. What I am trying to do is get it to act like "OpenPanel" or the alert dialog. Those return to the calling process when they are done and not before.

That *is* how a modal session acts. For example, let's assume a panel that's connected to the outlet named MyPanel. In that panel you have a table view named TableView. In some action method, you open the panel like this:

my $row = NSApplication->sharedApplication()->runModalForWindow($self- >myPanel());

How do you set the datasource for tableview. I usually call it right after displaying the window. I am not certain what procedure to put it in since there is not a constructor for the window that I am aware of.

The call to runModalForWindow: won't return until the modal session is stopped with stopModal, stopModalWithCode:, or abortModal. Let's assume you want it to return the selected row in TableView. In the action handler for the OK button, you'd have something like this:

sub okClicked : Selector(okClicked:) ArgTypes(@) ReturnType(v) {
        my ($self, $sender) = @_;
        my $rowSel = $self->tableView()->selectedRow();
        NSApplication->sharedApplication()->stopModalWithCode($rowSel);
}

This does not want to kill the window. I am looking for the description in the api docs. It looks like it is missing a reference to what window needs to be destroyed.

It does act as it should, however.


If you need to do something more complex, like return a string or object, just store it in an instance variable and use stopModal instead of returning it directly with stopModalWithCode.

I have tried waiting in a loop until a message comes back, but that gives me the technicolor pizza.

Like I said, that's by design. If you're spinning in a tight loop, you're not responding to events, and that means pizza.

Mmmm... Pizza....




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe