From: Andy S. <laz...@gm...> - 2009-08-16 01:08:31
|
Hi all. In TextView API, have function `textViewGetBuffer` with below describe: ------------------------------> describe start <------------------------------ Creates a new TextView widget displaying the buffer buffer. One buffer can be shared among many widgets. ------------------------------> describe end <------------------------------ Many TextView widget can shared one same TextBuffer content, when parent widget query TextView draw itself, TextView will draw corresponding part content of TextBuffer. So what's the principle that TextView can share same TextBuffer and display TextBuffer in TextView? How to implement this feature in Haskell level with API? Example, i plan write two module: DiredBuffer, DiredView, those modules for implement File Manager. DiredBuffer (like TextBuffer) use TreeList display directory content. DiredView (like TextView) can share DiredBuffer's content. And i can use function diredViewNewWithBuffer (silimar textViewNewWithBuffer) to split current window to two DiredView for display different part of given DiredBuffer. Someone can give me simple example code? Thanks! -- Andy |
From: Andy S. <laz...@gm...> - 2009-08-16 15:08:45
|
Andy Stewart <laz...@gm...> writes: I think TextBuffer just `data` object that deriving GObjectClass for keep buffer status, and TextView is `container` object that deriving ContainerClass for render buffer status of TextBuffer instance. So every TextView keep reference one TextBuffer object, if two TextView instances have same TextBuffer reference, then those two TextView instances can display same buffer content. All buffer status change is base on TextBuffer instance, if change buffer status, all corresponding TextView instance refersh for synchronous. My thinking is right? If not, please correct me! Thanks! -- Andy > Hi all. > > In TextView API, have function `textViewGetBuffer` with below describe: > > Creates a new TextView widget displaying the buffer buffer. > One buffer can be shared among many widgets. > > Many TextView widget can shared one same TextBuffer content, when > parent widget query TextView draw itself, TextView will draw > corresponding part content of TextBuffer. > > So what's the principle that TextView can share same TextBuffer and > display TextBuffer in TextView? > > How to implement this feature in Haskell level with API? > > Example, i plan write two module: DiredBuffer, DiredView, those modules > for implement File Manager. > > DiredBuffer (like TextBuffer) use TreeList display directory content. > DiredView (like TextView) can share DiredBuffer's content. > > And i can use function diredViewNewWithBuffer (silimar > textViewNewWithBuffer) to split current window to two DiredView for display > different part of given DiredBuffer. > > Someone can give me simple example code? > > Thanks! > > -- Andy > > > > > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july |
From: Axel S. <Axe...@en...> - 2009-08-17 10:13:08
|
On Aug 16, 2009, at 17:05, Andy Stewart wrote: > Andy Stewart <laz...@gm...> writes: > > I think TextBuffer just `data` object that deriving GObjectClass > for keep > buffer status, and TextView is `container` object that deriving > ContainerClass for render buffer status of TextBuffer instance. > > So every TextView keep reference one TextBuffer object, if two > TextView instances have same TextBuffer reference, then those two > TextView instances can display same buffer content. > > All buffer status change is base on TextBuffer instance, if change > buffer > status, all corresponding TextView instance refersh for synchronous. > > My thinking is right? If not, please correct me! > Yes, that's the principle. It's called model-view-controller (MVC) design where the model contains the data, the view is the widget presenting the data and the controller is the way the data is changed, implemented by the widget and your application. Axel. >> Hi all. >> >> In TextView API, have function `textViewGetBuffer` with below >> describe: >> >> Creates a new TextView widget displaying the buffer buffer. >> One buffer can be shared among many widgets. >> >> Many TextView widget can shared one same TextBuffer content, when >> parent widget query TextView draw itself, TextView will draw >> corresponding part content of TextBuffer. >> >> So what's the principle that TextView can share same TextBuffer and >> display TextBuffer in TextView? >> >> How to implement this feature in Haskell level with API? >> >> Example, i plan write two module: DiredBuffer, DiredView, those >> modules >> for implement File Manager. >> >> DiredBuffer (like TextBuffer) use TreeList display directory content. >> DiredView (like TextView) can share DiredBuffer's content. >> >> And i can use function diredViewNewWithBuffer (silimar >> textViewNewWithBuffer) to split current window to two DiredView >> for display >> different part of given DiredBuffer. >> >> Someone can give me simple example code? >> >> Thanks! >> >> -- Andy >> >> >> >> >> >> >> >> --------------------------------------------------------------------- >> --------- >> Let Crystal Reports handle the reporting - Free Crystal Reports >> 2008 30-Day >> trial. Simplify your report design, integration and deployment - >> and focus on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july > > > ---------------------------------------------------------------------- > -------- > Let Crystal Reports handle the reporting - Free Crystal Reports > 2008 30-Day > trial. Simplify your report design, integration and deployment - > and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Gtk2hs-users mailing list > Gtk...@li... > https://lists.sourceforge.net/lists/listinfo/gtk2hs-users |