The ZAZ Blog: When all you have is a chicken and a rocket launcher, make some really badass scrambled eggs.

Archives: Tutorials
« REALSyndication | Home | Windows »

Tip: Fix Linux Button Sizes

This really bugs me about Linux, at least on Ubuntu. Button sizes are typically 30 pixels tall, as opposed to the 20 pixels on Mac and Windows. So when you're creating your UI and plan to deploy to Linux as well, be aware of this. If your button sizes are 20 pixels tall - the REALbasic default - your buttons will look terrible on Linux, only showing the top half of the caption.

My solution? A subclass of PushButton I call RespectfulPushButton. In it's Open event, I simply make the height 10 pixels taller and move it up by 5 pixels. The result won't harm the UI much, and the buttons look perfect on Linux. You'll then want to define a new Open event, and trigger it from the Open event of the subclass. Of course, use conditional compiles to only resize the buttons on Linux. I then just use this subclass instead. Minimal work to setup, but you'll then need to get into the habit of using the subclass instead when placing new buttons.

PopupMenus have this pain as well. I have not seen this on any other controls, but I most write my own anyway.

[ Permalink | Accepting Comments (0) | Accepting Pings (0) ]

Image Masking

Over the past few days I've seen this topic come up on the REAL Software Forums and the REALbasic NUG. There's quite a mix of information - some correct and misleading. Luckily, I've not seen information that is just flat out wrong.

[ Read More | Package Included! | Accepting Comments (2) | Accepting Pings (0) ]

Custom Controls: Finding your global screen bounds

I find myself writing a fair amount of custom controls. Frequently, I find myself wanting to find the position of the mouse relative to my control. The MouseDown, MouseDrag, etc. events have this info, but if you need this in the Paint event, you must either save it to a property or get it from the system. We're exploring the latter, as it's not as simple as you might think.

[ Read More | Accepting Comments (0) | Accepting Pings (0) ]

Determining if a window should be highlighted

I've been working on a window designed to look similar to Safari. This means a window with a "Unified" toolbar and tabs that blend into said toolbar.

[ Read More | Accepting Comments (0) | Accepting Pings (0) ]

Does a window have a sheet?

So Norman Palardy recently posted some code for detecting if a window has a sheet attached. Charles Yeomans took this code and modified it to work without subclassing window.

I take it one step further, and fix a bug...

[ Read More | Accepting Comments (0) | Accepting Pings (0) ]

Source-Controlled Website

This concept is so simple and easy, I'm amazed I had not yet thought of it. See, I keep a subdomain of this website which I use as a sandbox. I draft new designs or concepts with it. But it's always been a complete pain to bring the sandbox to the live site. I don't want to overwrite too many or the wrong files, and I made the mistake of keeping subdomain files inside my www directory. It's a mess, and I know better now.

[ Read More | Accepting Comments (0) | Accepting Pings (0) ]

Creating Aqua effects in code

Using nothing but some gradient code and logic, you can creating Aqua effects using REALbasic code. We'll explain both.

[ Read More | Package Included! | Accepting Comments (0) | Accepting Pings (0) ]

Disclaimer: I am currently an employee of REAL Software. My comments and opinions are mine alone and do not represent those of my employer. My posts are not official REAL Software communications, and may contain information that is incorrect or misleading.