Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to create an application for the Ubuntu App Contest. And I defined image of the design, but I am having problems with it. Principally with the primary-toolbar design, so it would look like Ubuntu Software Center of even rhythmbox.

So my question is. How can I use this visual with MonoDevelop and the Mono/C# language ?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

If you are using Mono/C#, you may be out of luck at the moment, as the GTK+ 3.x bindings are not yet well tested or shipped in Ubuntu, and the primary toolbar setting API requires GTK+ 3.x.

To do this in a language where GTK+ 3.x is available, you can do this:

context = toolbar.get_style_context()
context.add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR)
share|improve this answer
    
Is there any way to use it without using python ? –  aliasbody Jun 22 '12 at 22:30
    
Yes, but not with Mono/C# at the moment, at least, not with the packages on Ubuntu currently. There is a GTK# 3.x port in the works, but it is not yet well tested, not released, and not packaged. The API would be the same though. You can use Vala or C to do it as well. –  dobey Jun 22 '12 at 22:55
    
The code you showed is to apply into the gtk design file right ? Because with mono I only have the XML gtk design file and the rest is all C# design files :S... (It is the first time I am using Mono, I was about to make the application for QT but since the GTK integration is not that good i just forgot that one :s) –  aliasbody Jun 23 '12 at 0:58
    
No. It's the code you would use to set the style class on the toolbar. You can't use it in Mono/C# becasue there are no GTK+ 3.x bindings for it. That code is usable basically as-is in Python or Vala, and is only slightly different in C, assuming you have a variable called "toolbar" for the Toolbar widget instance. –  dobey Jun 23 '12 at 1:13
    
I will try it with python under quickly just to see how it works –  aliasbody Jun 23 '12 at 1:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.