Lazarus

Installation => macOS / Mac OS X => Topic started by: abb on March 10, 2007, 03:59:04 pm

Title: Application.MessageBox-very big window!
Post by: abb on March 10, 2007, 03:59:04 pm
I'm trying to create a simplest carbon app. I've placed a TButton on a TForm and have added the OnClick eventhandler:

Code: [Select]
procedure TForm1.Button1Click(Sender: TObject);
begin
  Application.MessageBox('Button 1 is clicked',
                         'Information',
                         MB_OK);
end;

As a result a very large window appears on the screen -- I even don't see its title, but fortunately see the OK button at the bottom of screen, so I yet can close it... How to adjust the size of a messagebox window?

Also is there a special forum/section here to discuss several widgets, in particular Carbon widget?

Thanks in advance!
Title: RE: Application.MessageBox-very big window!
Post by: Zomis on March 11, 2007, 04:22:39 pm
Try the MessageDlg function in the Dialogs unit instead. See if that's any different. If it's the same, then something's probably wrong with your widgetset.
Title: Re: Application.MessageBox-very big window!
Post by: Phil on March 11, 2007, 06:44:40 pm
Quote from: "abb"
I'm trying to create a simplest carbon app. I've placed a TButton on a TForm and have added the OnClick eventhandler:

Code: [Select]
procedure TForm1.Button1Click(Sender: TObject);
begin
  Application.MessageBox('Button 1 is clicked',
                         'Information',
                         MB_OK);
end;

As a result a very large window appears on the screen -- I even don't see its title, but fortunately see the OK button at the bottom of screen, so I yet can close it... How to adjust the size of a messagebox window?

Also is there a special forum/section here to discuss several widgets, in particular Carbon widget?

Thanks in advance!


MessageBox has been implemented. Get the latest snapshot or recompile from SVN source.

I would suggest posting questions about Carbon under the OS X topic.
Title: Re: Application.MessageBox-very big window!
Post by: abb on March 12, 2007, 12:41:15 pm
Quote from: "Phil"
MessageBox has been implemented. Get the latest snapshot or recompile from SVN source.

I have 2007/02/25 version of both FPC and Lazarus. Are they not too fresh??? Can you explain how to update from SVN? I never delt with SVN...
Quote from: "Phil"
I would suggest posting questions about Carbon under the OS X topic.

OK, can you move this topic into that section? I beleaved that this is not an installation issue, so I decided to post it here... It would be good to have the OS-dependent areas not only for installation but also for development discussions. Hope you agree...
Title: Re: Application.MessageBox-very big window!
Post by: matthijs on March 12, 2007, 04:52:18 pm
Quote from: "abb"

I have 2007/02/25 version of both FPC and Lazarus. Are they not too fresh??? Can you explain how to update from SVN? I never delt with SVN...

Did you have a look at Getting the source (http://wiki.lazarus.freepascal.org/index.php/Getting_Lazarus)?
Title: Re: Application.MessageBox-very big window!
Post by: Phil on March 12, 2007, 11:40:57 pm
Quote from: "abb"
I have 2007/02/25 version of both FPC and Lazarus. Are they not too fresh??? Can you explain how to update from SVN? I never delt with SVN...


See the wiki for SVN stuff. If you install a more recent snapshot the compiled Carbon units will automatically be installed for you. I believe the patch was applied 2/26 so you just missed it.

I have no way of moving your message.
Title: RE: Re: Application.MessageBox-very big window!
Post by: felipemdc on March 13, 2007, 04:54:50 pm
I moved the topic.
Title: Re: Application.MessageBox-very big window!
Post by: abb on March 13, 2007, 08:38:51 pm
Quote from: "Phil"
See the wiki for SVN stuff. If you install a more recent snapshot the compiled Carbon units will automatically be installed for you. I believe the patch was applied 2/26 so you just missed it.

Ihave some troubles with SVN... Can I use daily snapshots instead of SVN? Are they not just the same? I've downloaded the snapshots of March, 11. Would it be OK?

Will try to update them...
Title: RE: Re: Application.MessageBox-very big window!
Post by: Vincent Snijders on March 13, 2007, 09:57:58 pm
Yes, they the daily snapshots are generated from the SVN version of Lazarus.

SVN uses less bandwidth if you update regularly.
Title: Re: Application.MessageBox-very big window!
Post by: Phil on March 13, 2007, 10:28:56 pm
Quote from: "abb"
Will try to update them...


See "Uninstalling Lazarus and Free Pascal" in this link if you want to uninstall your old snapshots first.

http://wiki.lazarus.freepascal.org/OS_X_Programming_Tips
Title: Re: Application.MessageBox-very big window!
Post by: abb on March 14, 2007, 12:46:52 pm
Quote from: "Phil"
See "Uninstalling Lazarus and Free Pascal" in this link if you want to uninstall your old snapshots first.

Should I do it or is it just an optional action?

As for SVN, I have a way to get files from any direct links for much lower price (I'm paying for traffic) than to use SVN, which will really download as many bytes as it is required and I don't know how much every update is. And I have no possibility to update all this stuff everyday. As I understand I'll do it just from time to time...
Title: Re: Application.MessageBox-very big window!
Post by: Phil on March 14, 2007, 10:19:19 pm
Quote from: "abb"
Should I do it or is it just an optional action?


It's up to you. I always run the uninstall script so I know I'm starting with a clean slate before I install new snapshots.

If you're uncomfortable running a script with sudo that wipes out the FPC and Lazarus folders the way the uninstall script does, you can drag them one at a time to the trash. You can also modify the script as needed.

What's really needed is an uninstall script included with Lazarus and FPC snapshots that does this. My script should still work but as folders and locations and included files change, it really needs to be included with the installers to ensure that it's up to date.

I also always move my Lazarus folder from usr/local/share to my home folder so I can recompile widgetsets and of course the uninstall script doesn't know anything about this.
Title: RE: Re: Application.MessageBox-very big window!
Post by: Vincent Snijders on March 14, 2007, 10:52:30 pm
What is the usual way to uninstall program installed by a .pkg file in Mac OS X?
Title: Re: RE: Re: Application.MessageBox-very big window!
Post by: Phil on March 14, 2007, 11:21:54 pm
Quote from: "Vincent"
What is the usual way to uninstall program installed by a .pkg file in Mac OS X?


With most apps, the user just drags the .app bundle to the trash. The .app bundle is really a folder but acts like a file as far as the user is concerned.

Lazarus and FPC are development tools and don't install .app bundles but rather various files and folders under /usr/local. I suppose a script would make the most sense here and developers should be able to use it. I believe that's what Mono does.

If the Carbon widgetset could one day be used to generate a native Lazarus executable that could be distributed as part of an .app bundle, Lazarus itself could be installed in the normal /Applications or /Developers (not at my Mac, but I think that's what it's called) folder. However, the FPC and LCL compiled units and source code would probably still go under /usr/local or in the user's home folder (perhaps this could be selected at installation). Technically, compiled units and source code could also go in the .app bundle as part of the app's resources, but this probably isn't the usual place with development tools.

With a Lazarus .app bundle, the user would then be able to start Lazarus by double-clicking, drag and drop it on the dock or move it anywhere they want, and easily uninstall it by dragging it to the trash.

Note that Apple's Xcode IDE is a normal OS X app bundle.
Title: Re: Application.MessageBox-very big window!
Post by: abb on March 15, 2007, 09:46:41 am
Quote from: "Phil"
It's up to you. I always run the uninstall script so I know I'm starting with a clean slate before I install new snapshots.

OK, no problems, I've done it. Now MessageBox appears correctly.
Quote from: "Phil"
I also always move my Lazarus folder from usr/local/share to my home folder so I can recompile widgetsets and of course the uninstall script doesn't know anything about this.

Can you describe what adjustments are required in the Lazarus Options when such moving is done? Also can you enumerate what particular subfolders are moved? Perhaps you have a script which moves these subfolders? And perhaps there is also uninstall script for them, which can clear these "custom" subfolders, when a new snapshot is installed? Could you share such scripts with me?
Thanks.
Title: Re: Application.MessageBox-very big window!
Post by: Phil on March 15, 2007, 08:37:00 pm
Quote from: "abb"
Can you describe what adjustments are required in the Lazarus Options when such moving is done? Also can you enumerate what particular subfolders are moved? Perhaps you have a script which moves these subfolders? And perhaps there is also uninstall script for them, which can clear these "custom" subfolders, when a new snapshot is installed? Could you share such scripts with me?


Copy the "lazarus" folder from /usr/local/share to your home folder (/Users/login). How do you get to the Lazarus folder? In Finder, choose Go | Go to Folder and enter /usr, then navigate to /usr/local/share. I assume you know how to copy files and folders in Finder. (Hint: Drag with the mouse.)

When done you can delete the lazarus folder under /usr/local/share.

You can modify the uninstall script as needed to delete the Lazarus folder created this way in your home folder.
Title: Re: Application.MessageBox-very big window!
Post by: abb on March 16, 2007, 06:48:16 am
Quote from: "Phil"
Copy the "lazarus" folder from /usr/local/share to your home folder (/Users/login). How do you get to the Lazarus folder? In Finder, choose Go | Go to Folder and enter /usr, then navigate to /usr/local/share. I assume you know how to copy files and folders in Finder. (Hint: Drag with the mouse.)

Have done! All is working perfectly. Now see my new topic about Carbon components here (http://www.lazarus.freepascal.org/index.php?name=PNphpBB2&file=viewtopic&t=3535).

Thanks.
TinyPortal © 2005-2018