How to set height of LinearLyout as matchparent programmatically - height

I want to set the height of a Linear layout to match parent but not getting how can i do this? I am noob in android programming. I tried to find it on this site but couldn't found. Your help will be appreciated.

LinearLayout l = new LinearLayout(this);
l.setLayoutParams(new
LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT));
l.setLayoutParams(new WindowManager.LayoutParams());
setContentView(l);

Related

Is there an example of a multiline text field in GTK+3 written in c++ without using css?

I'm having trouble figuring out the basic multi-line text field stuff in GTK+3. I was hoping someone could help me out with a simple example with no css formatting. I've done some googling and haven't found anything which I wouldn't have to deconstruct to get at the answer. Thanks.
Alright, I figured out how to do it.
GtkTextBuffer *textBufferName = gtk_text_buffer_new(NULL);
GtkWidget *widgetName = gtk_text_view_new_with_buffer(textBufferName);

Automatic Advanced styling for QGIS

I have a PostGIS database containing roads, waterbodies. POI, parks, etc that I have styled in QGIS following the very useful posts: Guide to Advanced Labeling for OSM Roads and “Google Maps”-Style Road Maps in QGIS of Anita Grasser.
I'm a python programmer and I would like to recreate these styles automatically not by hand, is it possible? Could anyone show me any example?
Thank you very much in advance!
In QGIS You can get labeling in command line choose layer and type
layer = iface.activeLayer()
layer.labelling()
You will get instance of QgsAbstractVectorLayerLabeling
https://qgis.org/pyqgis/master/core/Abstract/QgsAbstractVectorLayerLabeling.html?highlight=qgsabstractvectorlayerlabeling
To go to symbol You need type
layer = iface.activeLayer()
layer.renderer()
You will get class QgsFeatureRenderer https://qgis.org/pyqgis/master/core/Feature/QgsFeatureRenderer.html?highlight=qgsfeaturerenderer#qgis.core.QgsFeatureRenderer.symbols
You can also set renderer by
renderer = QgsFeatureRenderer()
layer.setRenderer(renderer)

make a auto adjustable QTextBrowser

hello i need make a auto adjustable QTextBrowser.
It's means the height of the QBrowserText depend of the number of rows it contained, somebody can help me please ?
Look at this page: http://qt-project.org/forums/viewthread/10240/
They used QDockWidget.
And here: http://www.mimec.org/node/383

Change image for Map aonnation view in rubymotion

I want to change UIAnnotationView image on mapkit in rubymotion language.
Any one know this, kindly help me.
How about a complete working example? I just tested it :)
A budy and I converted a LOT of iOS code from the iOS Cookbook to RubyMotion
There's a whole chapter on Maps, but the one that looks to answer your question best is this:
https://github.com/IconoclastLabs/rubymotion_cookbook/tree/master/ch_6/06_custompins
It's just like colored pins, but your main difference will be this
pinImage = UIImage.imageNamed("ilpin.png")
annotationView.image = pinImage
Goodluck! - Gant from Iconoclast Labs
I think you mean, an MKAnnotationView? If so, you just need to set the image property to a new UIImage. See this Gist:
https://gist.github.com/3049611
Based on the RubyMotionSamples Beer project - https://github.com/HipByte/RubyMotionSamples/blob/master/Beers/app/beer_map_controller.rb
I have added a new image file called 'signpost.png' under 'resources', and altered the code from using a pin to using a straight up annotation, with the new custom image.
The following code works fine to change the UIAnnotationView's image
view = MKAnnotationView.alloc.initWithAnnotation(annotation, reuseIdentifier:ViewIdentifier)
view.image = UIImage.imageNamed("ptr.jpg")
view.canShowCallout = true
I have saved the image ptr.jpg in resources folder.

Getting tab index in nsIWebProgressListener:: onStateChange in C++

I am developing Firefox extension in C++
I want to get the tab index of the tab window for which I have got STATE_STOP for STATE_IS_NETWORK.
i.e. I want to find the tab index associated with the request.
How do i get it?
Please help me !!!
Thanks in advance,
Vaibhav.
Solution is available at:
http://groups.google.com/group/mozilla.dev.tech.dom/browse_thread/thread/52ff471516662056#