Programming the Be Operating System

Overview

The Be operating system is a great platform just waiting for applications. Elegant, object-oriented to the core, and primed for great graphical interfaces, Be meets the needs of computer users at the turn of the century — but they call for equally elegant applications for displaying and manipulating content. This book gives C++ programmers their start to developing those applications.

Be will prove to be a pleasure for developers who have struggled with APIs on Microsoft ...

See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (12) from $1.99   
  • New (5) from $23.92   
  • Used (7) from $1.99   
Close
Sort by
Page 1 of 1
Showing 1 – 4 of 5
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$23.92
Seller since 2008

Feedback rating:

(169)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

New
1565924673 BRAND NEW NEVER USED IN STOCK 125,000+ HAPPY CUSTOMERS SHIP EVERY DAY WITH FREE TRACKING NUMBER

Ships from: fallbrook, CA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
$43.59
Seller since 2009

Feedback rating:

(856)

Condition: New
1565924673 *BRAND NEW* Ships Same Day or Next!

Ships from: Springfield, VA

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$45.00
Seller since 2014

Feedback rating:

(146)

Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
$50.47
Seller since 2014

Feedback rating:

(259)

Condition: New
Brand New Item.

Ships from: Chatham, NJ

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
Page 1 of 1
Showing 1 – 4 of 5
Close
Sort by
Sending request ...

Overview

The Be operating system is a great platform just waiting for applications. Elegant, object-oriented to the core, and primed for great graphical interfaces, Be meets the needs of computer users at the turn of the century — but they call for equally elegant applications for displaying and manipulating content. This book gives C++ programmers their start to developing those applications.

Be will prove to be a pleasure for developers who have struggled with APIs on Microsoft Windows, the Macintosh, or the X Window System. It provides consistent and intuitive methods for creating interfaces and handling messages. But you'll still have a hard time if all you have to learn from is official reference documentation like the Be Developer's Guide (also published by O'Reilly & Associates). This book is a traditional guide to application development that starts with the most basic concepts and leaves you with a firm foundation for further research.

The book begins with typical "Hello, world" programs and gradually adds elements of the graphical interface. It carefully describes drawing and message handling. While the focus is on the graphical interface, basic OS features like threads and file handling are also introduced.

Be runs on both PowerPC and Intel platforms, offering the same API on both. The programs in this book will therefore compile and run on any platform. Be's own integrated development environment, BeIDE (originally Metrowerks CodeWarrior), is used to develop all examples.

Read More Show Less

Product Details

  • ISBN-13: 9781565924673
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 6/8/1999
  • Pages: 400
  • Product dimensions: 7.04 (w) x 9.18 (h) x 0.81 (d)

Meet the Author

Sydow is a graduate of the Milwaukee School of Engineering.

Read More Show Less

Read an Excerpt


Chapter 8: Text

The BeOS makes it simple to display text in a view--you've seen several examples of calling the BView functions SetFont() and DrawString() to specify which font a view should use and then draw a line of text. This approach works fine for small amounts of plain text; your application, however, is more likely to be rich in both graphics and text--so you'll want to take advantage of the BFont, BStringView, BTextView, BScrollBar, and BScrollView classes.

The BFont class creates objects that define the characteristics of fonts. You create a BFont object based on an existing font, then alter any of several characteristics. The BeOS is quite adept at manipulating fonts. You can alter basic font features such as size and spacing, but you can also easily change other more esoteric font characteristics such as shear and angle of rotation. You can use this new font in subsequent calls to DrawString(), or as the font in which text is displayed in BStringView, BTextView, or BScrollView objects.

A BStringView object displays a line of text, as a call to the BView function DrawString() does. Because the text of a BStringView exists as an object, this text knows how to update itself--something that the text produced by a call to DrawString() doesn't know how to do.

More powerful than the BStringView class is the BTextView class. A BTextView object is used to display small or large amounts of editable text. The user can perform standard editing techniques (such as cut, copy, and paste) on the text of a BTextView object. And the user (or the program itself) can alter the font or font color of some or all of the text in such an object.

If the text of a BTextView object extends beyond the content area of the object, a scrollbar simplifies the user's viewing. The BScrollBar class lets you add a scrollbar to a BTextView. Before adding that scrollbar, though, you should consider creating a BScrollView object. As its name implies, such an object has built-in support for scrollbars. Create a BTextView object to hold the text, then create a BScrollView object that names the text view object as the scroll view's target. Or, if you'd like to scroll graphics rather than text, name a BView object as the target and then include a BPicture in that BView. While this chapter's focus is on text, it does close with an example adding scrollbars to a view that holds a picture.

Fonts

In the BeOS API, the BFont class defines the characteristics of a font--its style, size, spacing, and so forth. While the BFont class has not been emphasized in prior chapters, it has been used throughout this book. Every BView object (and thus every BView-derived object) has a current font that affects text displayed in that view. In previous examples, the BView-derived MyDrawView class used its AttachedToWindow() function to call a couple of BView functions to adjust the view's font: SetFont() to set the font, and SetFontSize() to set the font's size:

void MyDrawView::AttachedToWindow()
{
}

A view's current font is used in the display of characters drawn using the BView function DrawString(). Setting a view's font characteristics in the above fashion affects text produced by calls to DrawString() in each MyDrawView object.

The above snippet illustrates that the examples to this point have done little to alter the look of a font. Making more elaborate modifications is an easy task. Later in this chapter, you'll use some of the following techniques on text displayed in text view objects--editable text objects based on the BTextView class.

System Fonts

When designing the interface for your application, you'll encounter instances where you want a consistent look in displayed text. For example, your application may have a number of windows that include instructional text. In such a case, you'll want the text to have the same look from window to window. To ensure that your application can easily do this, the BeOS defines three fonts guaranteed to exist and remain constant for the running of your application.

The three global system fonts

The three constant fonts, or global system fonts, are BFont objects. When an application launches, these BFont objects are created, and three global pointers are assigned to reference them. Table 8-1 shows these global BFont objects. Figure 8-1 shows a window running on my machine; the figure includes a line of text written in each of the three system fonts.

Contradictory as it sounds, the user can change the font that's used for any of the global system fonts. Figure 8-2 shows that the FontPanel preferences program lets the user pick a different plain, bold, or fixed font. This means that your application can't count on a global font pointer (such as be_plain_font) always representing the same font on all users' machines. You can, however, count on a global font pointer to always represent only a single font on any given user's machine--regardless of which font that is. So while you may not be able to anticipate what font the user will view when you make use of a global font pointer in your application, you are assured that the user will view the same font each time that global font pointer is used by your application.

Using a global system font

You've already seen how to specify one of the global fonts as the font to be used by a particular view: just call the BView function SetFont() within one of the view's member functions. The AttachedToWindow() snippet that appears above provides an example. That method initializes all of the objects of a particular class to use the same font. In the above example, all MyDrawView objects will initially display text in the font referenced by be_bold_font. For a particular view to have its current font set to a different system font, have that view call SetFont() after the view has been created:

MyDrawView *theDrawView;
theDrawView = new MyDrawView(frameRect, "MyDrawView");
theDrawView->SetFont(be_plain_font);

While a BeOS machine may have more than the three system fonts installed, your application shouldn't make any font-related assumptions. You can't be sure every user has a non-system font your application uses; some users may experience unpredictable results when running your application. If you want your program to display text that looks different from the global fonts (such as a very large font like 48 points), you can still use a global font to do so, as the next section illustrates.

TIP: Your program shouldn't force the user to have a particular non- system font on his or her machine, but it can give the user the option of displaying text in a non-system font. Consider a word processor you're developing. The default font should be be_plain_font. But your application could have a Font menu that allows for the display of text in any font on the user's computer. Querying the user's machine for available fonts is a topic covered in the BFont section of the Interface Kit chapter of the Be Book.

Global fonts are not modifiable

A global font is an object defined to be constant, so it can't be altered by an application. If a program could alter a global font, the look of text in other applications would be affected. Instead, programs work with copies of global fonts. While calling a BView function such as SetFontSize() may seem to be changing the size of a font, it's not. A call to SetFontSize() simply specifies the point size at which to display characters. The font itself isn't changed -- the system simply calculates a new size for each character and displays text using these new sizes....

Read More Show Less

Table of Contents

Preface

1. BeOS Programming Overview
     Features of the BeOS
     Structure of the BeOS
     Software Kits and Their Classes
     BeOS Programming Fundamentals
     BeOS Programming Environment

2. BeIDE Projects
     Development Environment File Organization
     Examining an Existing BeIDE Project
     Setting up a New BeIDE Project
     HelloWorld Source Code

3. BeOS API Overview
     Overview of the BeOS Software Kits
     Software Kit Class Descriptions
     Chapter Example: Adding an Alert to MyHelloWorld

4. Windows, Views, and Messages
     Windows
     Views
     Messaging

5. Drawing
     Colors
     Patterns
     The Drawing Pen
     Shapes

6. Controls and Messages
     Introduction to Controls
     Buttons
     Picture Buttons
     Checkboxes
     Radio Buttons
     Text Fields
     Multiple Control Example Project

7. Menus
     Menu Basics
     Working With Menus
     Multiple Menus
     Pop-up Menus
     Submenus

8. Text
     Fonts
     Simple Text
     Editable Text
     Scrolling

9. Messages and Threads
     The Application Kit and Messages
     Application-Defined Messages

10. Files
     Files and the Storage Kit
     Using Standard Open and Save Panels
     Onward

Index

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)