Changeset a2bd75b in report


Ignore:
Timestamp:
Apr 4, 2003 6:37:30 PM (16 years ago)
Author:
Axel Simon <Axel.Simon@…>
Branches:
h2010, h98, master
Children:
4c5f826
Parents:
180f238
Message:

Added a simple proposal for setting and getting widget properties.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gui/poll.tex

    r180f238 ra2bd75b  
    577577values apply for every attribute).
    578578
     579Summing up the conversation about the set and get functions, I posted
     580the following proposal.
     581
     582\begin{verbatim}
     583-- An attribute is a property of a widget. It knows how to set the
     584-- and how to read the value of this property.
     585data WidgetClass w => Attr a w = <abstract>
     586
     587-- The assignment operator joins an attribute with its value.
     588(=:) :: a -> Attr a w -> Setter w
     589
     590-- Set and get can be used on every widget.
     591set :: WidgetClass w => w -> [Setter w] -> IO ()
     592get :: WidgetClass w => w -> Attr a w -> IO a
     593
     594-- An example for a Button widget: The constructor has one
     595-- mandatory argument.
     596newButton :: Container -> [Setter Button] -> IO Button
     597
     598-- The Button has at least this attribute.
     599label :: Attr String Button
     600
     601-- This is one callback the Button provides. Note that you cannot
     602-- attach any function at construction time or with the set
     603-- function. The returned action is the unregister function.
     604onClicked :: ButtonClass b => b -> IO () -> IO (IO ())
     605\end{verbatim}
     606
    579607\subsubsection{\label{secParentAsParameter} Composition of Objects
    580608  (Layout)}
Note: See TracChangeset for help on using the changeset viewer.