FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GTK Text Widget

 
Post new topic   Reply to topic     Forum Index -> MinWin
View previous topic :: View next topic  
Author Message
teqdruid



Joined: 11 May 2004
Posts: 390
Location: UMD

PostPosted: Fri Apr 08, 2005 7:15 am    Post subject: GTK Text Widget Reply with quote

GTK has a really cool text widget that allows all sorts of cool stuff, such as inserting random other widgets into it at certain points. It's also got some other formatting stuff, but I'm not familiar with it.

Does MinWin offer something similar? Can it? I'd rather use MinWin than GTK. Using the GTK backend, at least, it shouldn't be too hard to do it, since you'd just need wrappers.

John Demme
Back to top
View user's profile Send private message Send e-mail AIM Address
BenHinkle



Joined: 27 Mar 2004
Posts: 76

PostPosted: Fri Apr 08, 2005 9:19 am    Post subject: Reply with quote

For a multi-line text widget MinWin uses a GtkTextView. So if that is the widget you're thinking of you can grab the GTK peer using the peer property on the WindowChild. For example
Code:

 MultiLineText t = new MultiLineText(parent);
 GtkTextView* gtext = cast(GtkTextView*)t.peer;
 ... do stuff with gtext ...

If there is a better multi-line text component than GtkTextView I can change MinWin to use that. I just surfed around the Gtk documentation and it seemed like GtkTextView was the recommended text widget.

You can also wrap any GtkWidget using the generic PeerWrapper class. It just wraps a native widget in a MinWin object and plunks it in the MinWin hierarchy without any widget-specific capabilities. I haven't finished the documentation so it might not be mentioned there.
Back to top
View user's profile Send private message
teqdruid



Joined: 11 May 2004
Posts: 390
Location: UMD

PostPosted: Fri Apr 08, 2005 9:27 am    Post subject: Reply with quote

Quote:
You can also wrap any GtkWidget using the generic PeerWrapper class. It just wraps a native widget in a MinWin object and plunks it in the MinWin hierarchy without any widget-specific capabilities. I haven't finished the documentation so it might not be mentioned there.


And by doing this, I can treat it as a regular D object, in that I don't need to worry about freeing it, ect?

Also, if I was to build MinWin wrapper classes for the GTK Text stuff, would you add them to MinWin?

Lastly, is it possible to use MinWin on Windows with the GTK back-end? Eventually, I'll want my program to be cross-platform, and for the Text stuff to work on windows... once I get the stomache to put up with windows for a little while... so it would probably be some time.
Back to top
View user's profile Send private message Send e-mail AIM Address
BenHinkle



Joined: 27 Mar 2004
Posts: 76

PostPosted: Fri Apr 08, 2005 2:10 pm    Post subject: Reply with quote

teqDruid wrote:

And by doing this, I can treat it as a regular D object, in that I don't need to worry about freeing it, ect?


Good point. By default PeerWrapper assumes the user will dispose of everything. To let MinWin take care of it set the PeerWrapper's hasPeer property to OWNS_PEER (the default for PeerWrapper is FOREIGN_PEER).

teqDruid wrote:

Also, if I was to build MinWin wrapper classes for the GTK Text stuff, would you add them to MinWin?

If possible I'd like to keep the core stuff independent of the backend so I think I need a mechanism to have minwin extensions for special features like you suggest. My first guess is that declaring something an extension is just a matter of documenting what backends it requires and doesn't in fact need any code enforcement. Maybe a peer package of minwin called minwinx could contain the extensions. Whatever the mechanism I don't think it would be a problem.

teqDruid wrote:

Lastly, is it possible to use MinWin on Windows with the GTK back-end? Eventually, I'll want my program to be cross-platform, and for the Text stuff to work on windows... once I get the stomache to put up with windows for a little while... so it would probably be some time.

I was wondering about that myself. I haven't tried it. Note that if you think you'll be using GTK on multiple platforms it might make more sense to just stick with GTK everywhere or something like DUI instead of wrapping the whole thing in MinWin.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MinWin All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group