Re: TCL/TK Cocoa Port

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

Parent Message unknown Re: TCL/TK Cocoa Port

by Torsten Berg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

having not heard any progress on this front (Jason: how is it going?  
Something to show already?), I did a little research on this matter.  
What would it need to build the most simple Cocoa application, that  
is Tcl-enabled (has access to Tcl library functions and interpreter).  
I looked around and found this:

#import <Cocoa/Cocoa.h>
#include <tcl.h>

int main_simple(int argc, char *argv[]) {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

     [NSApplication sharedApplication];
     int style = NSClosableWindowMask | NSResizableWindowMask |
     NSTexturedBackgroundWindowMask | NSTitledWindowMask |  
NSMiniaturizableWindowMask;
     NSWindow *win = [[NSWindow alloc] initWithContentRect:NSMakeRect
(50, 50, 600, 400)
     styleMask:style
     backing:NSBackingStoreBuffered
     defer:NO];
     [win makeKeyAndOrderFront:win];
     [NSApp run];

     [pool release];
}

This can be put into a file named test.m and compiled with

   gcc test.m -o test -lobjc -Wno-import -framework Cocoa

and then run with

   ./test

from the command line. But the resulting application does not have a  
menu bar and it is nearly impossible to interact with. This means, a  
lot of the default behaviour supplied by making a simple program in  
XCode, is missing here. And this brings me to the point.

Until now, I have built Tcl/Tk for Aqua using the command 'make' as  
described in the manual inside the Tcl/Tk distribution. Now it seems,  
that Cocoa is inherently tied to XCode, making it impossible to build  
a future TkCocoa from the command line. Is this correct?

If correct, this would imply, that TkCocoa is dependent on XCode, it  
would no longer be a bunch of source code files readable and  
understandable by anyone looking inside, but would require having  
some NIB and other files and a lot of "under cover" logic and magic  
done by XCode.

Any insight on this?

Torsten

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Parent Message unknown Fwd: TCL/TK Cocoa Port

by Randall Wood-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, I failed to reply to the list


---------- Forwarded message ----------
From: Randall Wood <randall.h.wood@...>
Date: Thu, Jul 10, 2008 at 6:09 AM
Subject: Re: [MACTCL] TCL/TK Cocoa Port
To: Torsten Berg <reincke@...>


You can manually construct the entire UI in code. Its just not
recommended. You may want to take a look at how the GTK project and/or
the OpenOffice.org project is doing this.

On Thu, Jul 10, 2008 at 3:54 AM, Torsten Berg <reincke@...> wrote:

> Hi all,
>
> having not heard any progress on this front (Jason: how is it going?
> Something to show already?), I did a little research on this matter.
> What would it need to build the most simple Cocoa application, that
> is Tcl-enabled (has access to Tcl library functions and interpreter).
> I looked around and found this:
>
> #import <Cocoa/Cocoa.h>
> #include <tcl.h>
>
> int main_simple(int argc, char *argv[]) {
>     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
>
>     [NSApplication sharedApplication];
>     int style = NSClosableWindowMask | NSResizableWindowMask |
>     NSTexturedBackgroundWindowMask | NSTitledWindowMask |
> NSMiniaturizableWindowMask;
>     NSWindow *win = [[NSWindow alloc] initWithContentRect:NSMakeRect
> (50, 50, 600, 400)
>     styleMask:style
>     backing:NSBackingStoreBuffered
>     defer:NO];
>     [win makeKeyAndOrderFront:win];
>     [NSApp run];
>
>     [pool release];
> }
>
> This can be put into a file named test.m and compiled with
>
>   gcc test.m -o test -lobjc -Wno-import -framework Cocoa
>
> and then run with
>
>   ./test
>
> from the command line. But the resulting application does not have a
> menu bar and it is nearly impossible to interact with. This means, a
> lot of the default behaviour supplied by making a simple program in
> XCode, is missing here. And this brings me to the point.
>
> Until now, I have built Tcl/Tk for Aqua using the command 'make' as
> described in the manual inside the Tcl/Tk distribution. Now it seems,
> that Cocoa is inherently tied to XCode, making it impossible to build
> a future TkCocoa from the command line. Is this correct?
>
> If correct, this would imply, that TkCocoa is dependent on XCode, it
> would no longer be a bunch of source code files readable and
> understandable by anyone looking inside, but would require having
> some NIB and other files and a lot of "under cover" logic and magic
> done by XCode.
>
> Any insight on this?
>
> Torsten
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Tcl-mac mailing list
> tcl-mac@...
> https://lists.sourceforge.net/lists/listinfo/tcl-mac
>



--
Randall Wood
randall.h.wood@...

"The rules are simple: The ball is round. The game lasts 90 minutes.
All the rest is just philosophy."



--
Randall Wood
randall.h.wood@...

"The rules are simple: The ball is round. The game lasts 90 minutes.
All the rest is just philosophy."

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: TCL/TK Cocoa Port

by Kevin Walzer-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Torsten,

> having not heard any progress on this front (Jason: how is it going?  
> Something to show already?),

It's not clear what progress, if any, Jason has made. I know he's busy
with a lot of projects (he's a self-employed developer) so perhaps he
hasn't had time to get very far. Given the community's interest,
however, some update would be most welcome.

>I did a little research on this matter.  
> What would it need to build the most simple Cocoa application, that  
> is Tcl-enabled (has access to Tcl library functions and interpreter).  
> I looked around and found this:
>
> #import <Cocoa/Cocoa.h>
> #include <tcl.h>
>
> int main_simple(int argc, char *argv[]) {
>      NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
>
>      [NSApplication sharedApplication];
>      int style = NSClosableWindowMask | NSResizableWindowMask |
>      NSTexturedBackgroundWindowMask | NSTitledWindowMask |  
> NSMiniaturizableWindowMask;
>      NSWindow *win = [[NSWindow alloc] initWithContentRect:NSMakeRect
> (50, 50, 600, 400)
>      styleMask:style
>      backing:NSBackingStoreBuffered
>      defer:NO];
>      [win makeKeyAndOrderFront:win];
>      [NSApp run];
>
>      [pool release];
> }
>
> This can be put into a file named test.m and compiled with
>
>    gcc test.m -o test -lobjc -Wno-import -framework Cocoa
>
> and then run with
>
>    ./test
>
> from the command line.

I couldn't get your sample to compile as presented: gcc complained about
"undefined symbols: _main". I changed the function name from main_simple
to main and it compiled and ran fine.


 >But the resulting application does not have a
> menu bar and it is nearly impossible to interact with. This means, a  
> lot of the default behaviour supplied by making a simple program in  
> XCode, is missing here. And this brings me to the point.
>
> Until now, I have built Tcl/Tk for Aqua using the command 'make' as  
> described in the manual inside the Tcl/Tk distribution. Now it seems,  
> that Cocoa is inherently tied to XCode, making it impossible to build  
> a future TkCocoa from the command line. Is this correct?

No, I don't think that's correct. What you have here is a simple
function that draws a window, nothing more. There's no menu because you
haven't specified any menu in the code above. And the window is hard to
interact with because (I suspect) it isn't being run from inside an
application bundle.

>
> If correct, this would imply, that TkCocoa is dependent on XCode, it  
> would no longer be a bunch of source code files readable and  
> understandable by anyone looking inside, but would require having  
> some NIB and other files and a lot of "under cover" logic and magic  
> done by XCode.
>
> Any insight on this?

Xcode is just a Cocoa front end to gcc, gdb and other CLI tools, with a
decent text editor and project-organizing tools wrapped within.
Interface Builder (which designs the nib files/UI) just assembles
pickled/serialized Cocoa/Objective-C objects in a visual fashion; these
are "unarchived" at runtime by the compiled app. In other words, while
the visual tools provide a lot of convenience, there is no magic to
them. According to more seasoned Cocoa developers, anything that can be
done in a nib file can also be done in code--it  just requires a lot of
code, since you are interacting with the Cocoa frameworks at a lower
level. As a result, hardly any Cocoa developers work this way, and they
are not encouraged to work at a low level; there isn't a lot of material
out there showing how to do basic things like draw a window with a
simple menu and a button that displays "hello world" dialog, in plain code.

A Cocoa port of Tk, however, would need to specify nearly everything in
code--all the C code that currently draws windows, menus, buttons, etc.
using Carbon API's would have to be re-implemented as Objective-C code
calling Cocoa API's. As Randall pointed out, this is how the Gtk-OSX
developers are porting Gtk to run under Aqua; this is also how the Qt
and wxWidgets developers are doing things (although they are probably
using a lot of C++, which a Tk-Cocoa port wouldn't do). The Qt port to
Cocoa does use a nib file in a basic way (see
http://labs.trolltech.com/blogs/2008/03/03/qtmac-cocoa-port-alpha-released/),
but that's just a stub to hook into the windowing system and is tucked
away inside the framework bundle--hence developers using Qt wouldn't
need to worry about it.

I appreciate the code sample you've assembled here: it's stimulated a
lot of thought on my part. I'm in the process of learning Cocoa (and
developing a Cocoa application), not so much to become a Cocoa
developer, but to contribute in some way to the Tk-Cocoa port. I'm
estimating about a six-month learning curve before I'd be prepared in
any way to assist with the project, but once there, I'd be eager to
help, either with Jason's project or a different undertaking if his
project doesn't move forward.

Is anyone else willing to pitch in with this? I'm sure Jason would be
glad to have more folks contributing. This project is extremely
important for the future of Tk on OS X--I for one do not want to be
limited to using X11 Tk in a few years! Unfortunately, Daniel Steffen
has already said he does not have the time to do more than consult on
the port--so I really think it's up to the community. I know there's
enough expertise here to make it work, and we can't just wait for one
person to step forward and do the port. Let's see if we can get moving
and get a port together in 12-18 months!

Looking forward to others' viewpoints,
Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: TCL/TK Cocoa Port

by Torsten Berg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I couldn't get your sample to compile as presented: gcc complained  
> about "undefined symbols: _main". I changed the function name from  
> main_simple to main and it compiled and ran fine.

Oh, sorry. You are right. I had appended the _simple, because I  
tested some more variants in the same file and so to say "commented  
out" this one.

> >But the resulting application does not have a
>> menu bar and it is nearly impossible to interact with. This means,  
>> a  lot of the default behaviour supplied by making a simple  
>> program in  XCode, is missing here. And this brings me to the point.
>> Until now, I have built Tcl/Tk for Aqua using the command 'make'  
>> as  described in the manual inside the Tcl/Tk distribution. Now it  
>> seems,  that Cocoa is inherently tied to XCode, making it  
>> impossible to build  a future TkCocoa from the command line. Is  
>> this correct?
>
> No, I don't think that's correct. What you have here is a simple  
> function that draws a window, nothing more. There's no menu because  
> you haven't specified any menu in the code above. And the window is  
> hard to interact with because (I suspect) it isn't being run from  
> inside an application bundle.

I also tested some code from here: http://www.cocoabuilder.com/ 
archive/message/cocoa/2003/12/31/84618

But I got nowhere. The reason why I thought XCode would be required  
was some people on the net saying so. Now, your example of Qt, tells  
me it is possible. A little bit of more research also revealed this one:

http://lists.apple.com/archives/cocoa-dev/2004/Jul/msg00987.html

This loooong thread gives many details in the later posts and is  
quite enlightening. One of the posts there has more links:

http://lists.apple.com/archives/cocoa-dev/2004/Jul/msg00983.html

This one

http://www.gnustep.it/nicola/Tutorials/WindowsAndButtons/index.html

ist perhaps the best and GNUstep may even provide a starting  
point ... and this one

http://www.cocoabuilder.com/archive/message/cocoa/2004/6/7/109117

even has a reference to Tcl and the easy of creating dynamic GUIs there!

Home again! Tk is just great. There is nothing simpler and more  
powerful for GUIs than Tk!


Torsten

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: TCL/TK Cocoa Port

by J. Todd Slack :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Guys,

kevin is correct, things have been a little busy for me, but I am  
making progress on the port. @ of my projects come to finish early  
next week, so I will have a lot more time. .

I am working on an xCode/IB set of plugins for creating TCL/TK apps  
inside of XCode. It is a wizard type plugin that allows you to develop  
inside of Apple's tools. It will setup everything you need and create  
the build phases, targets, etc.  I thought about xCode and IB and  
ActiveState products like Komodo and TCL Dev kit and just thought the  
effort is worth it to just use the tools Apple provides to develop  
your apps. I live inside of XCode and IB and I guess at this point I  
dont like other tools. They are slow and dont conform to the way I  
expect an Apple Application to work.

The port to Cocoa has gone slow as I had a few projects to finish, so  
I start the plugins (easier to focus on when only having a few hours a  
day). I will be able to focus more early next week. I made this  
promise to complete this work and I have every intention of living up  
to my promise.

What I really need is a website.

Does anyone have a nice attractive Website that I can start from? I  
really like something like: http://madebysofa.com/
It is clean and simple and I like when you click on the column what it  
does.

Can anyone help? It would make providing updates easier.

-Jason


On Jul 10, 2008, at 8:19 AM, Kevin Walzer wrote:

> Hi Torsten,
>
>> having not heard any progress on this front (Jason: how is it going?
>> Something to show already?),
>
> It's not clear what progress, if any, Jason has made. I know he's busy
> with a lot of projects (he's a self-employed developer) so perhaps he
> hasn't had time to get very far. Given the community's interest,
> however, some update would be most welcome.
>
>> I did a little research on this matter.
>> What would it need to build the most simple Cocoa application, that
>> is Tcl-enabled (has access to Tcl library functions and interpreter).
>> I looked around and found this:
>>
>> #import <Cocoa/Cocoa.h>
>> #include <tcl.h>
>>
>> int main_simple(int argc, char *argv[]) {
>>     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
>>
>>     [NSApplication sharedApplication];
>>     int style = NSClosableWindowMask | NSResizableWindowMask |
>>     NSTexturedBackgroundWindowMask | NSTitledWindowMask |
>> NSMiniaturizableWindowMask;
>>     NSWindow *win = [[NSWindow alloc] initWithContentRect:NSMakeRect
>> (50, 50, 600, 400)
>>     styleMask:style
>>     backing:NSBackingStoreBuffered
>>     defer:NO];
>>     [win makeKeyAndOrderFront:win];
>>     [NSApp run];
>>
>>     [pool release];
>> }
>>
>> This can be put into a file named test.m and compiled with
>>
>>   gcc test.m -o test -lobjc -Wno-import -framework Cocoa
>>
>> and then run with
>>
>>   ./test
>>
>> from the command line.
>
> I couldn't get your sample to compile as presented: gcc complained  
> about
> "undefined symbols: _main". I changed the function name from  
> main_simple
> to main and it compiled and ran fine.
>
>
>> But the resulting application does not have a
>> menu bar and it is nearly impossible to interact with. This means, a
>> lot of the default behaviour supplied by making a simple program in
>> XCode, is missing here. And this brings me to the point.
>>
>> Until now, I have built Tcl/Tk for Aqua using the command 'make' as
>> described in the manual inside the Tcl/Tk distribution. Now it seems,
>> that Cocoa is inherently tied to XCode, making it impossible to build
>> a future TkCocoa from the command line. Is this correct?
>
> No, I don't think that's correct. What you have here is a simple
> function that draws a window, nothing more. There's no menu because  
> you
> haven't specified any menu in the code above. And the window is hard  
> to
> interact with because (I suspect) it isn't being run from inside an
> application bundle.
>
>>
>> If correct, this would imply, that TkCocoa is dependent on XCode, it
>> would no longer be a bunch of source code files readable and
>> understandable by anyone looking inside, but would require having
>> some NIB and other files and a lot of "under cover" logic and magic
>> done by XCode.
>>
>> Any insight on this?
>
> Xcode is just a Cocoa front end to gcc, gdb and other CLI tools,  
> with a
> decent text editor and project-organizing tools wrapped within.
> Interface Builder (which designs the nib files/UI) just assembles
> pickled/serialized Cocoa/Objective-C objects in a visual fashion;  
> these
> are "unarchived" at runtime by the compiled app. In other words, while
> the visual tools provide a lot of convenience, there is no magic to
> them. According to more seasoned Cocoa developers, anything that can  
> be
> done in a nib file can also be done in code--it  just requires a lot  
> of
> code, since you are interacting with the Cocoa frameworks at a lower
> level. As a result, hardly any Cocoa developers work this way, and  
> they
> are not encouraged to work at a low level; there isn't a lot of  
> material
> out there showing how to do basic things like draw a window with a
> simple menu and a button that displays "hello world" dialog, in  
> plain code.
>
> A Cocoa port of Tk, however, would need to specify nearly everything  
> in
> code--all the C code that currently draws windows, menus, buttons,  
> etc.
> using Carbon API's would have to be re-implemented as Objective-C code
> calling Cocoa API's. As Randall pointed out, this is how the Gtk-OSX
> developers are porting Gtk to run under Aqua; this is also how the Qt
> and wxWidgets developers are doing things (although they are probably
> using a lot of C++, which a Tk-Cocoa port wouldn't do). The Qt port to
> Cocoa does use a nib file in a basic way (see
> http://labs.trolltech.com/blogs/2008/03/03/qtmac-cocoa-port-alpha-released/)
> ,
> but that's just a stub to hook into the windowing system and is tucked
> away inside the framework bundle--hence developers using Qt wouldn't
> need to worry about it.
>
> I appreciate the code sample you've assembled here: it's stimulated a
> lot of thought on my part. I'm in the process of learning Cocoa (and
> developing a Cocoa application), not so much to become a Cocoa
> developer, but to contribute in some way to the Tk-Cocoa port. I'm
> estimating about a six-month learning curve before I'd be prepared in
> any way to assist with the project, but once there, I'd be eager to
> help, either with Jason's project or a different undertaking if his
> project doesn't move forward.
>
> Is anyone else willing to pitch in with this? I'm sure Jason would be
> glad to have more folks contributing. This project is extremely
> important for the future of Tk on OS X--I for one do not want to be
> limited to using X11 Tk in a few years! Unfortunately, Daniel Steffen
> has already said he does not have the time to do more than consult on
> the port--so I really think it's up to the community. I know there's
> enough expertise here to make it work, and we can't just wait for one
> person to step forward and do the port. Let's see if we can get moving
> and get a port together in 12-18 months!
>
> Looking forward to others' viewpoints,
> Kevin
>
> --
> Kevin Walzer
> Code by Kevin
> http://www.codebykevin.com
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Tcl-mac mailing list
> tcl-mac@...
> https://lists.sourceforge.net/lists/listinfo/tcl-mac



-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: TCL/TK Cocoa Port

by J. Todd Slack :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Guys,

BTW, if you want to discuss TCL/TK Cocoa Ports and related, feel free  
to use:

slackmoehrle_NOSPAM@...

(obviously remove the _NOSPAM)

I have my Blackberry with me all the time, but not always at my  
computer to answer.

Please just relevant TCL/TK Port items. Sometimes I dont check mailing  
lists for days.

-Jason

On Jul 14, 2008, at 7:54 AM, J. Todd Slack wrote:

> Hi Guys,
>
> kevin is correct, things have been a little busy for me, but I am
> making progress on the port. @ of my projects come to finish early
> next week, so I will have a lot more time. .
>
> I am working on an xCode/IB set of plugins for creating TCL/TK apps
> inside of XCode. It is a wizard type plugin that allows you to develop
> inside of Apple's tools. It will setup everything you need and create
> the build phases, targets, etc.  I thought about xCode and IB and
> ActiveState products like Komodo and TCL Dev kit and just thought the
> effort is worth it to just use the tools Apple provides to develop
> your apps. I live inside of XCode and IB and I guess at this point I
> dont like other tools. They are slow and dont conform to the way I
> expect an Apple Application to work.
>
> The port to Cocoa has gone slow as I had a few projects to finish, so
> I start the plugins (easier to focus on when only having a few hours a
> day). I will be able to focus more early next week. I made this
> promise to complete this work and I have every intention of living up
> to my promise.
>
> What I really need is a website.
>
> Does anyone have a nice attractive Website that I can start from? I
> really like something like: http://madebysofa.com/
> It is clean and simple and I like when you click on the column what it
> does.
>
> Can anyone help? It would make providing updates easier.
>
> -Jason
>
>
> On Jul 10, 2008, at 8:19 AM, Kevin Walzer wrote:
>
>> Hi Torsten,
>>
>>> having not heard any progress on this front (Jason: how is it going?
>>> Something to show already?),
>>
>> It's not clear what progress, if any, Jason has made. I know he's  
>> busy
>> with a lot of projects (he's a self-employed developer) so perhaps he
>> hasn't had time to get very far. Given the community's interest,
>> however, some update would be most welcome.
>>
>>> I did a little research on this matter.
>>> What would it need to build the most simple Cocoa application, that
>>> is Tcl-enabled (has access to Tcl library functions and  
>>> interpreter).
>>> I looked around and found this:
>>>
>>> #import <Cocoa/Cocoa.h>
>>> #include <tcl.h>
>>>
>>> int main_simple(int argc, char *argv[]) {
>>>    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
>>>
>>>    [NSApplication sharedApplication];
>>>    int style = NSClosableWindowMask | NSResizableWindowMask |
>>>    NSTexturedBackgroundWindowMask | NSTitledWindowMask |
>>> NSMiniaturizableWindowMask;
>>>    NSWindow *win = [[NSWindow alloc] initWithContentRect:NSMakeRect
>>> (50, 50, 600, 400)
>>>    styleMask:style
>>>    backing:NSBackingStoreBuffered
>>>    defer:NO];
>>>    [win makeKeyAndOrderFront:win];
>>>    [NSApp run];
>>>
>>>    [pool release];
>>> }
>>>
>>> This can be put into a file named test.m and compiled with
>>>
>>>  gcc test.m -o test -lobjc -Wno-import -framework Cocoa
>>>
>>> and then run with
>>>
>>>  ./test
>>>
>>> from the command line.
>>
>> I couldn't get your sample to compile as presented: gcc complained
>> about
>> "undefined symbols: _main". I changed the function name from
>> main_simple
>> to main and it compiled and ran fine.
>>
>>
>>> But the resulting application does not have a
>>> menu bar and it is nearly impossible to interact with. This means, a
>>> lot of the default behaviour supplied by making a simple program in
>>> XCode, is missing here. And this brings me to the point.
>>>
>>> Until now, I have built Tcl/Tk for Aqua using the command 'make' as
>>> described in the manual inside the Tcl/Tk distribution. Now it  
>>> seems,
>>> that Cocoa is inherently tied to XCode, making it impossible to  
>>> build
>>> a future TkCocoa from the command line. Is this correct?
>>
>> No, I don't think that's correct. What you have here is a simple
>> function that draws a window, nothing more. There's no menu because
>> you
>> haven't specified any menu in the code above. And the window is hard
>> to
>> interact with because (I suspect) it isn't being run from inside an
>> application bundle.
>>
>>>
>>> If correct, this would imply, that TkCocoa is dependent on XCode, it
>>> would no longer be a bunch of source code files readable and
>>> understandable by anyone looking inside, but would require having
>>> some NIB and other files and a lot of "under cover" logic and magic
>>> done by XCode.
>>>
>>> Any insight on this?
>>
>> Xcode is just a Cocoa front end to gcc, gdb and other CLI tools,
>> with a
>> decent text editor and project-organizing tools wrapped within.
>> Interface Builder (which designs the nib files/UI) just assembles
>> pickled/serialized Cocoa/Objective-C objects in a visual fashion;
>> these
>> are "unarchived" at runtime by the compiled app. In other words,  
>> while
>> the visual tools provide a lot of convenience, there is no magic to
>> them. According to more seasoned Cocoa developers, anything that can
>> be
>> done in a nib file can also be done in code--it  just requires a lot
>> of
>> code, since you are interacting with the Cocoa frameworks at a lower
>> level. As a result, hardly any Cocoa developers work this way, and
>> they
>> are not encouraged to work at a low level; there isn't a lot of
>> material
>> out there showing how to do basic things like draw a window with a
>> simple menu and a button that displays "hello world" dialog, in
>> plain code.
>>
>> A Cocoa port of Tk, however, would need to specify nearly everything
>> in
>> code--all the C code that currently draws windows, menus, buttons,
>> etc.
>> using Carbon API's would have to be re-implemented as Objective-C  
>> code
>> calling Cocoa API's. As Randall pointed out, this is how the Gtk-OSX
>> developers are porting Gtk to run under Aqua; this is also how the Qt
>> and wxWidgets developers are doing things (although they are probably
>> using a lot of C++, which a Tk-Cocoa port wouldn't do). The Qt port  
>> to
>> Cocoa does use a nib file in a basic way (see
>> http://labs.trolltech.com/blogs/2008/03/03/qtmac-cocoa-port-alpha-released/)
>> ,
>> but that's just a stub to hook into the windowing system and is  
>> tucked
>> away inside the framework bundle--hence developers using Qt wouldn't
>> need to worry about it.
>>
>> I appreciate the code sample you've assembled here: it's stimulated a
>> lot of thought on my part. I'm in the process of learning Cocoa (and
>> developing a Cocoa application), not so much to become a Cocoa
>> developer, but to contribute in some way to the Tk-Cocoa port. I'm
>> estimating about a six-month learning curve before I'd be prepared in
>> any way to assist with the project, but once there, I'd be eager to
>> help, either with Jason's project or a different undertaking if his
>> project doesn't move forward.
>>
>> Is anyone else willing to pitch in with this? I'm sure Jason would be
>> glad to have more folks contributing. This project is extremely
>> important for the future of Tk on OS X--I for one do not want to be
>> limited to using X11 Tk in a few years! Unfortunately, Daniel Steffen
>> has already said he does not have the time to do more than consult on
>> the port--so I really think it's up to the community. I know there's
>> enough expertise here to make it work, and we can't just wait for one
>> person to step forward and do the port. Let's see if we can get  
>> moving
>> and get a port together in 12-18 months!
>>
>> Looking forward to others' viewpoints,
>> Kevin
>>
>> --
>> Kevin Walzer
>> Code by Kevin
>> http://www.codebykevin.com
>>
>> -------------------------------------------------------------------------
>> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
>> Studies have shown that voting for your favorite open source project,
>> along with a healthy diet, reduces your potential for chronic  
>> lameness
>> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
>> _______________________________________________
>> Tcl-mac mailing list
>> tcl-mac@...
>> https://lists.sourceforge.net/lists/listinfo/tcl-mac
>
>
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Tcl-mac mailing list
> tcl-mac@...
> https://lists.sourceforge.net/lists/listinfo/tcl-mac



-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: TCL/TK Cocoa Port

by Kevin Walzer-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jason,

J. Todd Slack wrote:

> kevin is correct, things have been a little busy for me, but I am making
> progress on the port. @ of my projects come to finish early next week,
> so I will have a lot more time. .

Great! Thanks for checking in.

>
> I am working on an xCode/IB set of plugins for creating TCL/TK apps
> inside of XCode. It is a wizard type plugin that allows you to develop
> inside of Apple's tools. It will setup everything you need and create
> the build phases, targets, etc.  I thought about xCode and IB and
> ActiveState products like Komodo and TCL Dev kit and just thought the
> effort is worth it to just use the tools Apple provides to develop your
> apps. I live inside of XCode and IB and I guess at this point I dont
> like other tools. They are slow and dont conform to the way I expect an
> Apple Application to work.

This sounds interesting, more like the way PyObjC or Ruby-Cocoa works. I
am curious what you mean by "build," however--does this mean that each
application will build the Tcl/Tk frameworks as part of the build
process? There is already a way to build "standalone " Tcl/Tk
application bundles (the build process runs install_name_tool on the
frameworks), and you can just embed your scripts in the app bundle.

>
> The port to Cocoa has gone slow as I had a few projects to finish, so I
> start the plugins (easier to focus on when only having a few hours a
> day). I will be able to focus more early next week. I made this promise
> to complete this work and I have every intention of living up to my
> promise.

Great!

>
> What I really need is a website.
>
> Does anyone have a nice attractive Website that I can start from? I
> really like something like: http://madebysofa.com/
> It is clean and simple and I like when you click on the column what it
> does.

That website is slick, no doubt, but I'm sure it wasn't put together
from off-the-shelf parts; it probably has a lot of custom design and
programming behind it.

A better option for this project might be some sort of CMS. Once it's
set up, all you do is type in updates. RSS, design, and so on is taken
care of for you.

I'm also willing to assist with a more basic website if that's
acceptable--I have a site at http://tk-components.sf.net that has a
fairly clean layout using CSS.

Best,
Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: TCL/TK Cocoa Port

by J. Todd Slack :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Kevin,

> Great! Thanks for checking in.

Yes, not that I am trying to be quiet, just that I dont always check  
mailing lists for a few days. I am going to route tcl/TK to my  
Blackberry and filter based upon subjects a but to not get everything  
there.

>> I am working on an xCode/IB set of plugins for creating TCL/TK apps  
>> inside of XCode. It is a wizard type plugin that allows you to  
>> develop inside of Apple's tools. It will setup everything you need  
>> and create the build phases, targets, etc.  I thought about xCode  
>> and IB and ActiveState products like Komodo and TCL Dev kit and  
>> just thought the effort is worth it to just use the tools Apple  
>> provides to develop your apps. I live inside of XCode and IB and I  
>> guess at this point I dont like other tools. They are slow and dont  
>> conform to the way I expect an Apple Application to work.
>
> This sounds interesting, more like the way PyObjC or Ruby-Cocoa  
> works. I
> am curious what you mean by "build," however--does this mean that each
> application will build the Tcl/Tk frameworks as part of the build
> process? There is already a way to build "standalone " Tcl/Tk
> application bundles (the build process runs install_name_tool on the
> frameworks), and you can just embed your scripts in the app bundle.

So, basically the plugins all encompass other tools. From XCode you  
will be able to design, create the UI and build creating stand alone  
app bundles, etc. Does this make sense?

>> What I really need is a website.
>> Does anyone have a nice attractive Website that I can start from? I  
>> really like something like: http://madebysofa.com/
>> It is clean and simple and I like when you click on the column what  
>> it does.
>
> That website is slick, no doubt, but I'm sure it wasn't put together
> from off-the-shelf parts; it probably has a lot of custom design and
> programming behind it.
>
> A better option for this project might be some sort of CMS. Once it's
> set up, all you do is type in updates. RSS, design, and so on is taken
> care of for you.

True, items like RSS would be awesome. Maybe I can build something  
quickly in iWeb.  I might contact the guys at made By Sofa and inquire  
about their site. I really like the functionality.

-Jason



-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: TCL/TK Cocoa Port

by J. Todd Slack :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Everyone,

A few have offered web hosting services. I am all set in this arena. I  
have a 34mb down by 4mb up connection and a new SUN Server at my  
location. Thanks for the offers though.

The port is going, the XCode/IB integration is coming as well.

I just need a website!

-Jason

On Jul 14, 2008, at 8:32 AM, J. Todd Slack wrote:

> Hi Kevin,
>
>> Great! Thanks for checking in.
>
> Yes, not that I am trying to be quiet, just that I dont always check
> mailing lists for a few days. I am going to route tcl/TK to my
> Blackberry and filter based upon subjects a but to not get everything
> there.
>
>>> I am working on an xCode/IB set of plugins for creating TCL/TK apps
>>> inside of XCode. It is a wizard type plugin that allows you to
>>> develop inside of Apple's tools. It will setup everything you need
>>> and create the build phases, targets, etc.  I thought about xCode
>>> and IB and ActiveState products like Komodo and TCL Dev kit and
>>> just thought the effort is worth it to just use the tools Apple
>>> provides to develop your apps. I live inside of XCode and IB and I
>>> guess at this point I dont like other tools. They are slow and dont
>>> conform to the way I expect an Apple Application to work.
>>
>> This sounds interesting, more like the way PyObjC or Ruby-Cocoa
>> works. I
>> am curious what you mean by "build," however--does this mean that  
>> each
>> application will build the Tcl/Tk frameworks as part of the build
>> process? There is already a way to build "standalone " Tcl/Tk
>> application bundles (the build process runs install_name_tool on the
>> frameworks), and you can just embed your scripts in the app bundle.
>
> So, basically the plugins all encompass other tools. From XCode you
> will be able to design, create the UI and build creating stand alone
> app bundles, etc. Does this make sense?
>
>>> What I really need is a website.
>>> Does anyone have a nice attractive Website that I can start from? I
>>> really like something like: http://madebysofa.com/
>>> It is clean and simple and I like when you click on the column what
>>> it does.
>>
>> That website is slick, no doubt, but I'm sure it wasn't put together
>> from off-the-shelf parts; it probably has a lot of custom design and
>> programming behind it.
>>
>> A better option for this project might be some sort of CMS. Once it's
>> set up, all you do is type in updates. RSS, design, and so on is  
>> taken
>> care of for you.
>
> True, items like RSS would be awesome. Maybe I can build something
> quickly in iWeb.  I might contact the guys at made By Sofa and inquire
> about their site. I really like the functionality.
>
> -Jason
>
>
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Tcl-mac mailing list
> tcl-mac@...
> https://lists.sourceforge.net/lists/listinfo/tcl-mac



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: TCL/TK Cocoa Port

by Kevin Walzer-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

J. Todd Slack wrote:
>
> I just need a website!

Jason,

I strongly recommend a CMS or a blog. I don't think anyone on the list
has the skills to provide what you are asking for, a site like the Made
by Sofa site with lots of custom effects. You can install a CMS yourself
on your own system, configure it, and get it up and running quickly.

There are lots to evaluate at this URL:

http://www.opensourcecms.com/

HTH,
Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: TCL/TK Cocoa Port

by Cameron Laird-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jul 15, 2008 at 11:30:10PM -0400, Kevin Walzer wrote:
                        .
                        .
                        .

> > I just need a website!
>
> Jason,
>
> I strongly recommend a CMS or a blog. I don't think anyone on the list
> has the skills to provide what you are asking for, a site like the Made
> by Sofa site with lots of custom effects. You can install a CMS yourself
> on your own system, configure it, and get it up and running quickly.
>
> There are lots to evaluate at this URL:
>
> http://www.opensourcecms.com/
                        .
                        .
                        .
I often wonder if I "get" CMS.  I'm s'posed to be a professional,
even a respected industry commenter on it, but I keep running into
situations that make me wonder if I'm *really* missing things.  Is
<URL: http://wwww.madebysofa.com/ > what Jason was requesting?  I
sure didn't notice that.

I'm having terrible difficulties relating CMS ("or a blog"),
madebysofa, "lots of custom effects", what Jason requested, and
skills outside the possession of any of us.  If you have the
patience to fill in more of the picture, Kevin, you certainly have
my attention.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: TCL/TK Cocoa Port

by Jon Guyer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message