pyobjc-dev Mailing List for PyObjC (Page 189)
Brought to you by:
ronaldoussoren
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(1) |
Feb
(2) |
Mar
(3) |
Apr
(30) |
May
(18) |
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2002 |
Jan
(7) |
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
(3) |
Jul
(13) |
Aug
|
Sep
(23) |
Oct
(180) |
Nov
(291) |
Dec
(95) |
2003 |
Jan
(338) |
Feb
(352) |
Mar
(97) |
Apr
(46) |
May
(226) |
Jun
(184) |
Jul
(145) |
Aug
(141) |
Sep
(69) |
Oct
(161) |
Nov
(96) |
Dec
(90) |
2004 |
Jan
(66) |
Feb
(87) |
Mar
(98) |
Apr
(132) |
May
(115) |
Jun
(68) |
Jul
(150) |
Aug
(92) |
Sep
(59) |
Oct
(52) |
Nov
(17) |
Dec
(75) |
2005 |
Jan
(84) |
Feb
(191) |
Mar
(133) |
Apr
(114) |
May
(158) |
Jun
(185) |
Jul
(62) |
Aug
(28) |
Sep
(36) |
Oct
(88) |
Nov
(65) |
Dec
(43) |
2006 |
Jan
(85) |
Feb
(62) |
Mar
(92) |
Apr
(75) |
May
(68) |
Jun
(101) |
Jul
(73) |
Aug
(37) |
Sep
(91) |
Oct
(65) |
Nov
(30) |
Dec
(39) |
2007 |
Jan
(24) |
Feb
(28) |
Mar
(10) |
Apr
(2) |
May
(18) |
Jun
(16) |
Jul
(21) |
Aug
(6) |
Sep
(30) |
Oct
(31) |
Nov
(153) |
Dec
(31) |
2008 |
Jan
(63) |
Feb
(70) |
Mar
(47) |
Apr
(24) |
May
(59) |
Jun
(22) |
Jul
(12) |
Aug
(7) |
Sep
(14) |
Oct
(26) |
Nov
(5) |
Dec
(5) |
2009 |
Jan
(10) |
Feb
(41) |
Mar
(70) |
Apr
(88) |
May
(49) |
Jun
(62) |
Jul
(34) |
Aug
(15) |
Sep
(55) |
Oct
(40) |
Nov
(67) |
Dec
(21) |
2010 |
Jan
(60) |
Feb
(17) |
Mar
(26) |
Apr
(26) |
May
(29) |
Jun
(4) |
Jul
(21) |
Aug
(21) |
Sep
(10) |
Oct
(12) |
Nov
(3) |
Dec
(19) |
2011 |
Jan
(3) |
Feb
(13) |
Mar
(8) |
Apr
(8) |
May
(17) |
Jun
(20) |
Jul
(21) |
Aug
(7) |
Sep
|
Oct
|
Nov
(9) |
Dec
(11) |
2012 |
Jan
(3) |
Feb
|
Mar
|
Apr
(5) |
May
(4) |
Jun
(14) |
Jul
(5) |
Aug
(2) |
Sep
(15) |
Oct
(2) |
Nov
(23) |
Dec
(1) |
2013 |
Jan
(8) |
Feb
(1) |
Mar
|
Apr
|
May
(5) |
Jun
(1) |
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(12) |
Nov
(10) |
Dec
(3) |
2014 |
Jan
(7) |
Feb
(14) |
Mar
(2) |
Apr
|
May
(2) |
Jun
(11) |
Jul
(10) |
Aug
(4) |
Sep
|
Oct
(8) |
Nov
(1) |
Dec
(2) |
2015 |
Jan
(9) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(7) |
Jun
|
Jul
(5) |
Aug
(6) |
Sep
|
Oct
(1) |
Nov
(4) |
Dec
|
2016 |
Jan
(1) |
Feb
(1) |
Mar
(4) |
Apr
(2) |
May
(1) |
Jun
|
Jul
(6) |
Aug
(8) |
Sep
(21) |
Oct
(17) |
Nov
|
Dec
(36) |
2017 |
Jan
(6) |
Feb
(2) |
Mar
(4) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(6) |
2018 |
Jan
(2) |
Feb
(3) |
Mar
(3) |
Apr
(14) |
May
(2) |
Jun
(2) |
Jul
(4) |
Aug
(3) |
Sep
(6) |
Oct
(16) |
Nov
(1) |
Dec
(6) |
2019 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(7) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
(1) |
2021 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(5) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2025 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: sean <sa...@se...> - 2004-04-22 03:09:50
|
Больше нет нужды в спешке застилать кровать покрывалом. Новая коллекция постельных принадлежностей от www.mypresent.ru позволит вашей квартире выглядять уютно и блистательно в любом виде и любой ситуации. |
From: Akhar <ak...@gm...> - 2004-04-22 03:08:32
|
I seem to have been able to fix my problem by taking out (pyScript) ----Script.m, #import "Script.h" @implementation Script(pyScript) //<- offending line + instantiateSubclassNamed:(NSString*) aClassName { Class aClass = NSClassFromString(aClassName); return [[aClass alloc] init]; } @end BUT i do get another error which is : creating object *** -[scr test]: selector not recognized An uncaught exception was raised *** -[scr test]: selector not recognized *** Uncaught exception: <NSInvalidArgumentException> *** -[scr test]: selector not recognized QuickShell has exited due to signal 5 (SIGTRAP). cheers Stephane |
From: Akhar <ak...@gm...> - 2004-04-20 23:40:17
|
I seem to have a bit of a problem with calling python objects from cocoa apps. I did find your post on soureforge about how it could be done (http://sourceforge.net/mailarchive/message.php?msg_id=7503787). I tried to do as the poster did however I need to call the python code from another object that is linked to a custom view. Here is what I have : -----main.m #import <Cocoa/Cocoa.h> #import <PythonGlue.h> #import <Script.h> int main(int argc, const char *argv[]) { return NSApplicationMain(argc, argv); } -----myoutput.h, /* outputView */ #import <Cocoa/Cocoa.h> #import <PythonGlue.h> #import <Script.h> @interface outputView : NSView { NSString *command; NSColor *bgColor; NSMutableDictionary *attributes; Script *script; } - (void)prepareAttributes; - (void)drawStringCenteredIn: (NSRect)bounds; - (void)setBgColor:(NSColor *)c; - (NSColor *)bgColor; - (void)setString: (NSString *)cmd; - (NSString *)command; @end ----myoutput.m, #import "outputView.h" @implementation outputView - (id)initWithFrame:(NSRect)rect { if (self = [super initWithFrame:rect]) { [[PythonGlue alloc] init]; scr = [Script instantiateSubclassNamed:@"pyScript"]; // this is where it should run the python code NSLog(@"initializing view the big one"); [self prepareAttributes]; [self setBgColor:[NSColor yellowColor]]; [self setString:@"Nothing to see here! move on!"]; } return self; } ... more ... but ... cut ... @end ----Script.h, /* Shell */ #import <Cocoa/Cocoa.h> @interface Script : NSObject + instatiateSubclassNamed: (NSString *) aClassName; @end @interface Script (pyScript) - (void) test; @end ----Script.m, #import "Script.h" @implementation Script(pyScript) + instantiateSubclassNamed:(NSString*) aClassName { Class aClass = NSClassFromString(aClassName); return [[aClass alloc] init]; } @end ----pyScript.py from objc import * from Foundation import * from AppKit import * Script = lookUpClass("Scipt") class pyScript(Script): def init(self): print "creating object" return self def test_(self, obj): print "in python here test worked" and the pythonglue.h/.m and the python framework. From that standpoint all seems great. I have the exact same setup as he does except for the main.m that was left as is. instead in myoutput.h I created the Script *py; variable to my knowledge this is not the problem, I get a: objc.nosuchclass_error: 'Script' is not defined. error. What am i doing wrong? Regards Stephane |
From: E-Ticket-Marketing.com <no...@e-...> - 2004-04-19 23:31:09
|
No text version was provided |
From: ernesto <dam...@t-...> - 2004-04-19 19:14:16
|
Ни для кого не секрет, что успех любого дела зависит от того, насколько мотивированы сотрудники на его выполнение. У Вас отличная команда, но сотрудники не горят желанием работать? Все можно исправить! Как сделать так, чтобы сотрудники с энтузиазмом работали, не требуя бесконечных прибавок к зарплате? Чтобы успех дела они считали своим личным успехом? Как вдохновить их на новые достижения? Обо всем этом пойдет речь на двухдневном практическом семинаре-тренинге: «Разработка системы мотивации персонала» 26-27 апреля. Программа семинара-тренинга: Модуль I. Концепции мотивации. • Механизм мотивации. • Классические и современные подходы к мотивации: различные мотивационные теории, их анализ и границы применения. Факторы демотивации • Отражения различных теорий в имеющемся опыте участников программы. Модуль II. Принципы трудовой мотивации. 1.Мотивация персонала на уровне организации. • Мотивационные стратегии. •Связь мотивации персонала с системой оценки и планирования развития. • Модель мотивационной оценки персонала. • Примеры удачных и неудачных систем мотивации. • Система материального и нематериального стимулирования: ограничения и возможности. • Корпоративная культура: корпоративные ценности и нормы как факторы мотивации. •Специфика больших и малых компаний в области мотивации персонала. • Парадоксы мотивации. 2. Мотивация одного сотрудника. «Повседневная мотивация». • Создание мотивирующей рабочей среды. •Мотивация через постановку задач и организацию системы обратной связи. Модуль III. Что делать? • Методы оценки актуальной мотивационной среды компании («Что сейчас мотивирует и демотивирует моих сотрудников»). • Шаги построения системы мотивации. • Премии. Доплаты. Бонусы. Льготы. Социальный пакет: когда и в каком количестве. • Определение эффективности системы мотивации организации. • Обсуждение различных подходов на примерах участников программы. Стоимость участия в мастер-классе - 7500 рублей, в т.ч. НДС. Форма оплаты любая (наличная или безналичная). в пакет услуг входит: участие в мероприятии, информационные печатные материалы кофе-пауза, обед. место проведения мастер-класса Москва м. Академическая. Время проведения с 10 до 17.30. Для участия в семинаре необходимо регистрироваться. Помимо участия в семинаре у Вас есть уникальная возможность приобрести видеозапись мероприятия (На CD,DVD или видеокассетах). К видеоматериалам прилагается раздаточный материал. Стоимость видеоматериалов– 4500 руб. с учетом НДС При участии в мероприятии или покупке видеоматериалов мы выдаем полный пакет документов для бухгалтерии. Предлагаем видеозаписи других семинаров по темам: 1. Методы оценки и подбора персонала в организации. 2. Типы людей в бизнесе (оценка поведения Ваших партнеров и коллег) 3. Хитрости ежедневного руководства. Контактные телефоны (095) 207-26-21 и (095) 789-81-90 |
From: <bo...@se...> - 2004-04-18 06:01:08
|
<html> <body> <p align="center"> <img src="cid:BC419E61.C6E36813.D0D1CCF4.D13CA6C5_csseditor"><p align="center"> </p> <p align="center"><font color="#FDFDFD" size="1">поругался с Кубраком: взводный посоветовал ему не беспокоиться о чужом</font></p> <p align="center"><font color="#FDFDFD" size="1">за валом старой монгольской крепостцы. Мечик, передав кобылу Бакланову,</font></p> <p align="center"><font color="#FDFDFD" size="1">страничкесссылками,которыепомогут</font></p> <p align="center"><font color="#FDFDFD" size="1">восемнадцать, что молча ехали следом, -- и перестал плакать; нужно было жить</font></p> <p align="center"><font color="#FDFDFD" size="1">Какавиакомпания"ИстернЭйрЛайнс"собираеттолпылюбопытныхна</font></p> <p align="center"><font color="#FDFDFD" size="1">карьера Вильсона потерпела крушение, его здоровье пошатнулось, a жизнь</font></p> <p align="center"><font color="#FDFDFD" size="1">лет. Ради бога, почему бы тебе не говорить так как говорят люди? Почему бы</font></p> <p align="center"><font color="#FDFDFD" size="1">БитваприГеттисбергевтечениетрехпервыхднейиюля1863года.</font></p> <p align="center"><font color="#FDFDFD" size="1">Какразделитьоднутелефоннуюлиниюнадвефизические</font></p> </body> </html> |
From: Daniell R. <vrq...@bb...> - 2004-04-17 06:27:00
|
overstock betelgeuse indiana oppugnancy epochal encompass gaul melioribus cananga destinate salaam ronald engels dulcify preterit submersion allseeing serein hatter griveous birthright umbilicus barge calcify bicycling foolish jiggered |
From: laurae <sh...@t-...> - 2004-04-15 16:14:23
|
Ни для кого не секрет, что успех любого проекта зависит от того, насколько мотивированы сотрудники на его выполнение. У Вас отличная команда, но сотрудники не горят желанием работать? Все можно исправить! Как сделать так, чтобы сотрудники с энтузиазмом работали, не требуя бесконечных прибавок к зарплате? Чтобы успех дела они считали своим личным успехом? Как вдохновить их на новые достижения? Обо всем этом пойдет речь на двухдневном практическом семинаре-тренинге: «Разработка системы мотивации персонала» 21-22 апреля. Программа семинара-тренинга: Модуль I. Концепции мотивации. • Механизм мотивации. • Классические и современные подходы к мотивации: различные мотивационные теории, их анализ и границы применения. Факторы демотивации • Отражения различных теорий в имеющемся опыте участников программы. Модуль II. Принципы трудовой мотивации. 1.Мотивация персонала на уровне организации. • Мотивационные стратегии. •Связь мотивации персонала с системой оценки и планирования развития. • Модель мотивационной оценки персонала. • Примеры удачных и неудачных систем мотивации. • Система материального и нематериального стимулирования: ограничения и возможности. • Корпоративная культура: корпоративные ценности и нормы как факторы мотивации. •Специфика больших и малых компаний в области мотивации персонала. • Парадоксы мотивации. 2. Мотивация отельного сотрудника. «Повседневная мотивация». • Создание мотивирующей рабочей среды. •Мотивация через постановку задач и организацию системы обратной связи. Модуль III. Что делать? • Методы оценки актуальной мотивационной среды компании («Что сейчас мотивирует и демотивирует моих сотрудников»). • Шаги построения системы мотивации. • Премии. Доплаты. Бонусы. Льготы. Социальный пакет: как правильно формировать. • Оценка эффективности системы мотивации организации. • Отработка различных подходов на примерах участников программы. Стоимость участия в мастер-классе - 7500 рублей, учетом НДС. Форма оплаты любая (наличная или безналичная). В стоимость входит: участие в мероприятии, информационные печатные материалы кофе-пауза, обед. место проведения мастер-класса Москва м. Академическая. Начало - в 10 часов и окончание - в 17.30 - 18.00. Регистрация участников обязательна. Помимо участия в семинаре у Вас есть уникальная возможность приобрести видеозапись мероприятия (На CD,DVD или видеокассетах). К видеозаписи прилагается раздаточный материал. Стоимость видеоматериалов– 4500 руб. в т.ч. НДС При участии в мастер-классе или покупке видеоматериалов мы выдаем стандартный пакет документов для бухгалтерии. Предлагаем видеозаписи других семинаров по темам: 1. Методы оценки и подбора персонала в организации. 2. Типы людей в бизнесе (оценка поведения Ваших партнеров и коллег) 3. Хитрости ежедневного руководства. Контактные телефоны (095) 207-26-21 и (095) 789-81-90 |
From: <zan...@ey...> - 2004-04-15 11:05:48
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>企业网站免费建设及推广全面解决方案</title> <style type="text/css"> <!-- .ab { font-size: 14px; line-height: 25px; text-decoration: none; } --> </style> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //--> </script> </head> <body background="http://www.i18.cn/images/back.gif" leftmargin="0" topmargin="0" onLoad="MM_openBrWindow('http://www.bf365.net','中华零售网','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600')"> <table width="750" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="10"><img src="http://www.i18.cn/images/123.gif" width="290" height="87"></td> <td width="740" align="right" valign="bottom" background="http://www.i18.cn/images/1234.gif"><a href="http://www.cnretail.com" target="_blank"><img src="http://www.i18.cn/images/one/logo.gif" width="131" height="51" border="0"></a></td> </tr> </table> <table width="750" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="500" valign="top" bgcolor="#FFFFFF"> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="25"> <div align="center"> <p class="ab"><strong>企业网站免费建设及推广全面解决方案</strong></p> </div></td> </tr> <tr> <td class="ab"><p>尊敬的客户,您好!<br> 您的企业具有一定规模,产品质量也是同类中的佼佼者,可为什么销售额没有其他的公司大呢?“酒好不怕巷子深”这句古语在现今网络高速发展的时代早已成为了历史,不再实用。好的产品没有好的宣传推广,市场占比也不会太大。怎样能够更好的推广我们的产品、我们的企业呢?传通的推广方式虽然有一定的效果,可费用太高,做为中小型企业我们何不选择费用低、效果好的推广宣传方式呢?<br> 网络迅速发展,目前为目,国家统计局数字2003年底国内上网人数达8000万左右,而且急速上升。如此大的市场,为何不选择网络推广呢?我们的建站及推广方案如下:<br> <strong>一、企业网站建设方案:<br> <span class="ab">1、</span></strong>如果您还没有网站,那就不要犹豫,快进来吧,建设您自己的网站吧!<a href="http://www.bf365.net/main/home/htm.php?nowmenuid=3" target="_blank">点击注册建站</a><br> <strong>2、</strong>您已经拥有网站,可网站维护、资料修改让您头疼,而且不愿雇用网站技术人员,<a href="http://www.bf365.net/main/home/htm.php?nowmenuid=3" target="_blank">请进这里注册吧</a>!把您的烦恼交给我们吧!<br> <strong>3</strong>、网站等于企业的门面,漂亮的网站使访问者(潜在顾客)感到爽心悦目,记忆深刻。如果现有的网站您并不满意,也请您<a href="http://www.bf365.net/main/home/htm.php?nowmenuid=3" target="_blank">注册</a>建设自己的网站,一定不会让您失望。<br> 4、如果您对建站系统不太了解,可以把您公司的资料及产品信息发给我们,一切由我们帮你搞定。 <br> </p></td> </tr> <tr> <td><span class="ab"><strong>建站系统功能简介:</strong><br> ・ 800多款精美的网页模版任意挑选;<br> ・ 功能强大的在线网页编辑器,任意图文混排; <br> ・ 简、繁、英三种语言版本,简繁自动转换; <br> ・ 自由增加、修改、删除栏目;隐藏或加密栏目; <br> ・ 网站功能非常丰富,如:新闻文章、图文展示、在线表单、访客留言、文件下载、网上购物等; <br> ・ 使用代码生成器,实现首页内容动态更新; <br> ・ 拥有自己的会员数据库; <br> ・ 网站名称自动生成美观的名称图片; <br> ・ 各种网站辅助功能样样齐全; </span><br> </td> </tr> <tr> <td><p class="ab"><strong>二、网站推广方案:<br> </strong>拥有一个漂亮的网站是宣传企业及产品的前提,接下来需要做的工作是推广,推广工作也是宣传的关键。推广工作做的好,您的企业及产品将快速得到人们的认识。推广方案如下:<br> 1、与“中华零售网”免费链接;中华零售网为行业门户网站,每天访问量突破20,0000人次;<br> 2、帮您登陆大型搜索引擎,如百度、google、雅虎等;<br> 3、帮您的网站通过邮件方式发送到您的目标客户邮箱;<br> 4、帮您的网站登陆到“中华零售网”的企业库,给您带来更多的商机;<br> 5、……<br> 通过一系统的推广方式使您的网站快速成长起来。<br> <strong> 联系电话:</strong>(010)65707596 <br> <strong>免费申请:</strong><a href="http://www.bf365.net/main/home/r0.php" target="_blank">http://www.bf365.net/main/home/r0.php</a> <br> <strong> </strong></p> </td> </tr> </table> </td> </tr> </table> <table width="768" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="656" bgcolor="#FFFFFF"> </td> <td width="112" align="right"><img src="http://www.i18.cn/images/115.gif" width="112" height="48"></td> </tr> </table> <p class="ab"> </p> </body> </html> |
From: Ronald O. <ron...@ma...> - 2004-04-15 05:15:03
|
On 14-apr-04, at 23:32, Bob Ippolito wrote: > >> def getFrameFromPaperSize(self, size): >> return ((0, 0), (10, 10)) > > def getFrameFromPaperSize_(klass, size): > return ((0, 0), (10, 10)) > # this should technically have a signature that returns NSRect and > takes NSSize. Changing the signature is only necessary when the method will be called from Objective-C *and* PyObjC cannot know the signature (you never have to supply an explicit signature when overriding an existing method). > # I'll leave that as an exercise to the reader > getFrameFromPaperSize_ = selector(getFrameFromPaperSize_, > isClassMethod=True) or: getFrameFromPaperSize_ = classmethod(getFrameFromPaperSize_) -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |
From: Bob I. <bo...@re...> - 2004-04-14 22:01:16
|
On Apr 14, 2004, at 5:51 PM, Jiva DeVoe wrote: > Thanks, that's very helpful. Is there a good place to read up on this > subject? (Docs?) > > On Apr 14, 2004, at 2:32 PM, Bob Ippolito wrote: >>> class BaseView(NSView): >>> def __new__(cls, *args, **kwargs): >>> return cls.alloc().init() >> >> Is this really a good idea? >> > > This is taken straight from some example (I forget which) - as a > "pythonic constructor" so I can use this class in another python file > more pythonically... > > Mainly, I use it for unit testing... (if ever) For this class it's totally worthless (as-is, at least), so I wouldn't have it in there.. -bob |
From: Jiva D. <ji...@de...> - 2004-04-14 21:51:51
|
Thanks, that's very helpful. Is there a good place to read up on this subject? (Docs?) On Apr 14, 2004, at 2:32 PM, Bob Ippolito wrote: >> class BaseView(NSView): >> def __new__(cls, *args, **kwargs): >> return cls.alloc().init() > > Is this really a good idea? > This is taken straight from some example (I forget which) - as a "pythonic constructor" so I can use this class in another python file more pythonically... Mainly, I use it for unit testing... (if ever) -- Jiva DeVoe jiva at devoesquared.com http://www.devoesquared.com |
From: Bob I. <bo...@re...> - 2004-04-14 21:27:48
|
On Apr 14, 2004, at 4:59 PM, Jiva DeVoe wrote: > How do I call functions in a class which inherits from an objc class > *before* i have finished initializing self? My goal here is to call > some subfunctions in my constructor before calling the inherited > constructor. But self is not yet initialized, so it doesn't work... You don't. You want class methods. > So, say I have the following code in a python file: > > from Foundation import * > from AppKit import * from objc import selector > class BaseView(NSView): > def __new__(cls, *args, **kwargs): > return cls.alloc().init() Is this really a good idea? > def initWithFrame_(self, frame): > super(BaseView, self).initWithFrame_(frame) > return self self is allowed to change after an init call! def initWithFrame_(self, frame): self = super(BaseView, self).initWithFrame_(frame) return self > def initWithPrintInfo_(self, info): > self.info = info > > self.frame = self.getFrameFromPaperSize(info.papersize()) > > self.initWithFrame_(frame) > > return self Note that you did misspell paperSize ... def initWithPrintInfo_(self, info): frame = self.__class__.getFrameFromPaperSize_(info.paperSize()) self = self.initWithFrame_(frame) return self > def getFrameFromPaperSize(self, size): > return ((0, 0), (10, 10)) def getFrameFromPaperSize_(klass, size): return ((0, 0), (10, 10)) # this should technically have a signature that returns NSRect and takes NSSize. # I'll leave that as an exercise to the reader getFrameFromPaperSize_ = selector(getFrameFromPaperSize_, isClassMethod=True) > class Inherit1(BaseView): > def getFrameFromPaperSize(self, size): > return ((0, 0), (20, 20)) def getFrameFromPaperSize_(klass, size): return ((0, 0), (20, 20)) # the selector wrapper is not necessary here, it'll get picked up because we're subclassing |
From: Jiva D. <ji...@de...> - 2004-04-14 20:59:56
|
How do I call functions in a class which inherits from an objc class *before* i have finished initializing self? My goal here is to call some subfunctions in my constructor before calling the inherited constructor. But self is not yet initialized, so it doesn't work... So, say I have the following code in a python file: from Foundation import * from AppKit import * class BaseView(NSView): def __new__(cls, *args, **kwargs): return cls.alloc().init() def initWithFrame_(self, frame): super(BaseView, self).initWithFrame_(frame) return self def initWithPrintInfo_(self, info): self.info = info self.frame = self.getFrameFromPaperSize(info.papersize()) self.initWithFrame_(frame) return self def getFrameFromPaperSize(self, size): return ((0, 0), (10, 10)) class Inherit1(BaseView): def getFrameFromPaperSize(self, size): return ((0, 0), (20, 20)) class Inherit2(BaseView): def getFrameFromPaperSize(self, size): return ((0, 0), (30, 30)) See what I am trying to do? What should I do? -- Jiva DeVoe jiva at devoesquared.com http://www.devoesquared.com |
From: Ted H. <ho...@ub...> - 2004-04-14 19:27:07
|
Excellent, thanks! On Wed, 14 Apr 2004, Ronald Oussoren wrote: > On 14-apr-04, at 20:07, Ted Horst wrote: > > > > > I would like to use getRectsBeingDrawn:count: in a python NSView > > subclass, > > but I don't know how to declare the signature properly. I tried: > > > > setSignatureForSelector('NSView', 'getRectsBeingDrawn:count:', > > 'v@:o^{_NSRect={_NSPoint=ff}{_NSSize=ff}}o^i') > > > > and I get a rect back, but the data is bogus (not surprisingly). If I > > use: > > > > setSignatureForSelector('NSView', 'getRectsBeingDrawn:count:', > > 'v@:o^^{_NSRect={_NSPoint=ff}{_NSSize=ff}}o^i') > > > > I get something back (a PyObjCPointer), but I don't know how to access > > it. > > > > What is the proper signature and usage of a method like this (ie one > > that > > returns a variable length list of struct through a pointer to a > > pointer). > > This cannot be solved in plain python, because the first argument is > used to return an array of objects. > > This is fixed in revision 1.6 of > Modules/AppKit/_AppKitMapping_NSView.m, which should surface in a day > or so. With that you can do:: > > rects, count = myView.getRectsBeingDrawn_count() > > Ronald > -- > X|support bv <http://www.xsupport.nl/ > T: +31 610271479 F: +31 204416173 > |
From: Ronald O. <ron...@ma...> - 2004-04-14 19:16:13
|
On 14-apr-04, at 20:07, Ted Horst wrote: > > I would like to use getRectsBeingDrawn:count: in a python NSView > subclass, > but I don't know how to declare the signature properly. I tried: > > setSignatureForSelector('NSView', 'getRectsBeingDrawn:count:', > 'v@:o^{_NSRect={_NSPoint=ff}{_NSSize=ff}}o^i') > > and I get a rect back, but the data is bogus (not surprisingly). If I > use: > > setSignatureForSelector('NSView', 'getRectsBeingDrawn:count:', > 'v@:o^^{_NSRect={_NSPoint=ff}{_NSSize=ff}}o^i') > > I get something back (a PyObjCPointer), but I don't know how to access > it. > > What is the proper signature and usage of a method like this (ie one > that > returns a variable length list of struct through a pointer to a > pointer). This cannot be solved in plain python, because the first argument is used to return an array of objects. This is fixed in revision 1.6 of Modules/AppKit/_AppKitMapping_NSView.m, which should surface in a day or so. With that you can do:: rects, count = myView.getRectsBeingDrawn_count() Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |
From: Ted H. <ho...@ub...> - 2004-04-14 18:08:27
|
I would like to use getRectsBeingDrawn:count: in a python NSView subclass, but I don't know how to declare the signature properly. I tried: setSignatureForSelector('NSView', 'getRectsBeingDrawn:count:', 'v@:o^{_NSRect={_NSPoint=ff}{_NSSize=ff}}o^i') and I get a rect back, but the data is bogus (not surprisingly). If I use: setSignatureForSelector('NSView', 'getRectsBeingDrawn:count:', 'v@:o^^{_NSRect={_NSPoint=ff}{_NSSize=ff}}o^i') I get something back (a PyObjCPointer), but I don't know how to access it. What is the proper signature and usage of a method like this (ie one that returns a variable length list of struct through a pointer to a pointer). Thanks, Ted |
From: Bob I. <bo...@re...> - 2004-04-14 14:07:20
|
On Apr 14, 2004, at 9:46 AM, David Giffin wrote: > I have been using PyObjC for a few weeks now and as a rule, I love it. > I have hit a snag though. When I bundle an application using the > --standalone option it builds, but the program fails when it goes to > use a socket. This problem doesn't occur when I build with the > --sem-standalone option, only when using the --standalone. The program > actually continues to run, no crash or anything, but it does not do > it's socket communications. The actual error that I find in the > console is: > > no codec search functions registered: can't find encoding > > Any help with this would be appreciated. I am running on Panther with > all the latest updates. The whole reason I need the --standalone > option is because I have been getting requests for programs I have > written from users on Jaguar, and the programs won't run on Jaguar as > --semi-shared. It has nothing to do with sockets really, you probably just need to include the encodings package, the _codecs extension, and the codecs module. These are all imported implicitly by Python internals as-needed, so BundleBuilder isn't necessarily going to pick it up on its own. -bob |
From: Ronald O. <ron...@ma...> - 2004-04-14 14:05:07
|
On 14-apr-04, at 15:46, David Giffin wrote: > Hello all, > > I have been using PyObjC for a few weeks now and as a rule, I love it. > I have hit a snag though. When I bundle an application using the > --standalone option it builds, but the program fails when it goes to > use a socket. This problem doesn't occur when I build with the > --sem-standalone option, only when using the --standalone. The program > actually continues to run, no crash or anything, but it does not do > it's socket communications. The actual error that I find in the > console is: > > no codec search functions registered: can't find encoding > > Any help with this would be appreciated. I am running on Panther with > all the latest updates. The whole reason I need the --standalone > option is because I have been getting requests for programs I have > written from users on Jaguar, and the programs won't run on Jaguar as > --semi-shared. It's unlikely that the python installation from Panther will work on Jaguar. But anyway, you need to tell bundlebuilder that it must include the encodings package. Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |
From: David G. <dg...@da...> - 2004-04-14 13:46:26
|
Hello all, I have been using PyObjC for a few weeks now and as a rule, I love it. I have hit a snag though. When I bundle an application using the --standalone option it builds, but the program fails when it goes to use a socket. This problem doesn't occur when I build with the --sem-standalone option, only when using the --standalone. The program actually continues to run, no crash or anything, but it does not do it's socket communications. The actual error that I find in the console is: no codec search functions registered: can't find encoding Any help with this would be appreciated. I am running on Panther with all the latest updates. The whole reason I need the --standalone option is because I have been getting requests for programs I have written from users on Jaguar, and the programs won't run on Jaguar as --semi-shared. Thanks, David Giffin http://www.davtri.com |
From: <zan...@ey...> - 2004-04-14 11:27:44
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>企业网站免费建设及推广全面解决方案</title> <style type="text/css"> <!-- .ab { font-size: 14px; line-height: 25px; text-decoration: none; } --> </style> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //--> </script> </head> <body background="http://www.i18.cn/images/back.gif" leftmargin="0" topmargin="0" onLoad="MM_openBrWindow('http://www.bf365.net','中华零售网','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600')"> <table width="750" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="10"><img src="http://www.i18.cn/images/123.gif" width="290" height="87"></td> <td width="740" align="right" valign="bottom" background="http://www.i18.cn/images/1234.gif"><a href="http://www.cnretail.com" target="_blank"><img src="http://www.i18.cn/images/one/logo.gif" width="131" height="51" border="0"></a></td> </tr> </table> <table width="750" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="500" valign="top" bgcolor="#FFFFFF"> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="25"> <div align="center"> <p class="ab"><strong>企业网站免费建设及推广全面解决方案</strong></p> </div></td> </tr> <tr> <td class="ab"><p>尊敬的客户,您好!<br> 您的企业具有一定规模,产品质量也是同类中的佼佼者,可为什么销售额没有其他的公司大呢?“酒好不怕巷子深”这句古语在现今网络高速发展的时代早已成为了历史,不再实用。好的产品没有好的宣传推广,市场占比也不会太大。怎样能够更好的推广我们的产品、我们的企业呢?传通的推广方式虽然有一定的效果,可费用太高,做为中小型企业我们何不选择费用低、效果好的推广宣传方式呢?<br> 网络迅速发展,目前为目,国家统计局数字2003年底国内上网人数达8000万左右,而且急速上升。如此大的市场,为何不选择网络推广呢?我们的建站及推广方案如下:<br> <strong>一、企业网站建设方案:<br> <span class="ab">1、</span></strong>如果您还没有网站,那就不要犹豫,快进来吧,建设您自己的网站吧!<a href="http://www.bf365.net/main/home/htm.php?nowmenuid=3" target="_blank">点击注册建站</a><br> <strong>2、</strong>您已经拥有网站,可网站维护、资料修改让您头疼,而且不愿雇用网站技术人员,<a href="http://www.bf365.net/main/home/htm.php?nowmenuid=3" target="_blank">请进这里注册吧</a>!把您的烦恼交给我们吧!<br> <strong>3</strong>、网站等于企业的门面,漂亮的网站使访问者(潜在顾客)感到爽心悦目,记忆深刻。如果现有的网站您并不满意,也请您<a href="http://www.bf365.net/main/home/htm.php?nowmenuid=3" target="_blank">注册</a>建设自己的网站,一定不会让您失望。<br> 4、如果您对建站系统不太了解,可以把您公司的资料及产品信息发给我们,一切由我们帮你搞定。 <br> </p></td> </tr> <tr> <td><span class="ab"><strong>建站系统功能简介:</strong><br> ・ 800多款精美的网页模版任意挑选;<br> ・ 功能强大的在线网页编辑器,任意图文混排; <br> ・ 简、繁、英三种语言版本,简繁自动转换; <br> ・ 自由增加、修改、删除栏目;隐藏或加密栏目; <br> ・ 网站功能非常丰富,如:新闻文章、图文展示、在线表单、访客留言、文件下载、网上购物等; <br> ・ 使用代码生成器,实现首页内容动态更新; <br> ・ 拥有自己的会员数据库; <br> ・ 网站名称自动生成美观的名称图片; <br> ・ 各种网站辅助功能样样齐全; </span><br> </td> </tr> <tr> <td><p class="ab"><strong>二、网站推广方案:<br> </strong>拥有一个漂亮的网站是宣传企业及产品的前提,接下来需要做的工作是推广,推广工作也是宣传的关键。推广工作做的好,您的企业及产品将快速得到人们的认识。推广方案如下:<br> 1、与“中华零售网”免费链接;中华零售网为行业门户网站,每天访问量突破20,0000人次;<br> 2、帮您登陆大型搜索引擎,如百度、google、雅虎等;<br> 3、帮您的网站通过邮件方式发送到您的目标客户邮箱;<br> 4、帮您的网站登陆到“中华零售网”的企业库,给您带来更多的商机;<br> 5、……<br> 通过一系统的推广方式使您的网站快速成长起来。<br> <strong> 联系电话:</strong>(010)65707596 <br> <strong>免费申请:</strong><a href="http://www.bf365.net/main/home/r0.php" target="_blank">http://www.bf365.net/main/home/r0.php</a> <br> <strong> </strong></p> </td> </tr> </table> </td> </tr> </table> <table width="768" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="656" bgcolor="#FFFFFF"> </td> <td width="112" align="right"><img src="http://www.i18.cn/images/115.gif" width="112" height="48"></td> </tr> </table> <p class="ab"> </p> </body> </html> |
From: Bob I. <bo...@re...> - 2004-04-12 23:48:46
|
On Apr 12, 2004, at 7:21 PM, Paul Donovan wrote: > Hi, > > I'm trying to use the new NSUserDefaultsController (part of Cocoa > Bindings). I've got some example code in Obj-C (from > http://homepage.mac.com/mmalc/CocoaExamples/controllers.html), but I'm > having trouble converting it to PyObjC. > > The original Obj-C code is: > > // Get font name and size from user defaults > NSDictionary *values = [[NSUserDefaultsController > sharedUserDefaultsController] values]; > NSString *fontName = [values valueForKey:@"FontName"]; > > So I've converted it to this: > > prefs = > NSUserDefaultsController.sharedUserDefaultsController().values() > print prefs > print prefs['FontName'] > > Results in: > > <_NSControllerObjectProxy: 0x1123830> > 2004-04-13 00:12:22.453 Test[19056] An exception has occured: > Traceback (most recent call last): > File > "/Users/pauld/Projects/Test/build/Test.app/Contents/Resources/ > __main__.py", line 18, in ? > AppHelper.runEventLoop(argv=[]) > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site-packages/PyObjC/PyObjCTools/AppHelper.py", line 71, in > runEventLoop > NSApplicationMain(argv) > File > "/Users/pauld/Projects/Test/build/Test.app/Contents/Resources/ > RatingsModel.py", line 46, in awakeFromNib > self.makeLibrary(file) > File > "/Users/pauld/Projects/Test/build/Test.app/Contents/Resources/ > RatingsModel.py", line 29, in makeLibrary > print prefs['FontName'] > TypeError: unsubscriptable object > > I'm not sure why the type of 'prefs' is an NSControllerObjectProxy. I > was expecting it to be an NSDictionary* (and hence a python > dictionary). I have an instance of an NSUserDefaultsController in my > nib file, so I'm a bit stuck at this point. > > I'm using pyobjc from anonymous CVS as of a couple of days ago, on > 10.3.3. It's not a NSDictionary or a subclass of NSDictionary so PyObjC doesn't know that it needs the __getitem__ mapping. It can't automatically say that all bridged objects should use valueForKey: for __getitem__ because some should map to objectAtIndex: You'll have to use the literal translation, at least for now: prefs.valueForKey_(u'FontName') Note that unicode strings are the literal translation of ObjC @"strings". Regular Python strings can potentially hit an exception at the bridge and always incur additional encoding overhead... and besides, you should probably get in the habit of using unicode for all text anyway. -bob |
From: b.bum <bb...@ma...> - 2004-04-12 23:45:16
|
On Apr 12, 2004, at 4:21 PM, Paul Donovan wrote: > <_NSControllerObjectProxy: 0x1123830> > 2004-04-13 00:12:22.453 Test[19056] An exception has occured: > Traceback (most recent call last): > File > "/Users/pauld/Projects/Test/build/Test.app/Contents/Resources/ > __main__.py", line 18, in ? > AppHelper.runEventLoop(argv=[]) > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site-packages/PyObjC/PyObjCTools/AppHelper.py", line 71, in > runEventLoop > NSApplicationMain(argv) > File > "/Users/pauld/Projects/Test/build/Test.app/Contents/Resources/ > RatingsModel.py", line 46, in awakeFromNib > self.makeLibrary(file) > File > "/Users/pauld/Projects/Test/build/Test.app/Contents/Resources/ > RatingsModel.py", line 29, in makeLibrary > print prefs['FontName'] > TypeError: unsubscriptable object > > I'm not sure why the type of 'prefs' is an NSControllerObjectProxy. I > was expecting it to be an NSDictionary* (and hence a python > dictionary). I have an instance of an NSUserDefaultsController in my > nib file, so I'm a bit stuck at this point. It is an NSCOP because it is not a static dictionary of values. It is literally a proxy to the NSUserDefaultsController. This raises a slightly different issue -- one that we have sort of punted on for a while. Since KVC -- key/value coding -- is implemented on NSObject [both -valueForKey: and -setValue:forKey:] is there any reason to not support subscript style access to all Obj-C objects passed to the python side of the bridge? It is a trivial change to make it so, I believe. b.bum |
From: Paul D. <pa...@do...> - 2004-04-12 23:21:47
|
Hi, I'm trying to use the new NSUserDefaultsController (part of Cocoa Bindings). I've got some example code in Obj-C (from http://homepage.mac.com/mmalc/CocoaExamples/controllers.html), but I'm having trouble converting it to PyObjC. The original Obj-C code is: // Get font name and size from user defaults NSDictionary *values = [[NSUserDefaultsController sharedUserDefaultsController] values]; NSString *fontName = [values valueForKey:@"FontName"]; So I've converted it to this: prefs = NSUserDefaultsController.sharedUserDefaultsController().values() print prefs print prefs['FontName'] Results in: <_NSControllerObjectProxy: 0x1123830> 2004-04-13 00:12:22.453 Test[19056] An exception has occured: Traceback (most recent call last): File "/Users/pauld/Projects/Test/build/Test.app/Contents/Resources/ __main__.py", line 18, in ? AppHelper.runEventLoop(argv=[]) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/PyObjC/PyObjCTools/AppHelper.py", line 71, in runEventLoop NSApplicationMain(argv) File "/Users/pauld/Projects/Test/build/Test.app/Contents/Resources/ RatingsModel.py", line 46, in awakeFromNib self.makeLibrary(file) File "/Users/pauld/Projects/Test/build/Test.app/Contents/Resources/ RatingsModel.py", line 29, in makeLibrary print prefs['FontName'] TypeError: unsubscriptable object I'm not sure why the type of 'prefs' is an NSControllerObjectProxy. I was expecting it to be an NSDictionary* (and hence a python dictionary). I have an instance of an NSUserDefaultsController in my nib file, so I'm a bit stuck at this point. I'm using pyobjc from anonymous CVS as of a couple of days ago, on 10.3.3. Cheers, Paul |
From: b.bum <bb...@ma...> - 2004-04-11 22:01:14
|
On Apr 11, 2004, at 2:45 PM, Jordan Krushen wrote: > Does anyone know if it's possible to hijack the Create Files command > in IB after mucking around with the nib, to have it create the > appropriate python files in Xcode (noting outlet names and such, like > when running NibClassBuilder manually)? With the Xcode templates, > and a couple changes to IB, it would effectively be the same as > working with Objective-C, albeit with a more enjoyable language. It isn't currently -- please file a bug via bugreport.apple.com, if you want the feature (seriously -- it works). b.bum |