grid

Zurb Foundation 5: Grid Column Stacking

孤街醉人 提交于 2019-12-04 17:54:00
I'm new to foundation and I only have the basic idea on how to use grids. I have these 3 columns that need to be stacked (see "mobile" image) when viewed on mobile/small screens. It should look something like this when in larger screens: Here's my current code. It's not quite what I wanted, and I'm starting to get confused. <div class="row"> <div class="large-12" style="background-color:#bdc3c7;"> <div class="medium-4 medium-push-8 columns" style="background-color: #1abc9c; border: 1px solid #2c3e50;"> <p>TOP ROW</p> </div> <div class="medium-8 medium-pull-4 columns" style="background-color:

Python 3 Tkinter - Create Text Widget covering 100% Width with Grid

廉价感情. 提交于 2019-12-04 17:26:51
I know that you can easily create a Tkinter Text widget that covers 100% of the width using the Pack Geometry Manager: from tkinter import * root = Tk() textWidget = Text(root) textWidget.pack(side=TOP, fill=X) root.geometry('600x1000') root.mainloop() But I was wondering, how do I accomplish this same task using the Grid Geometry Manager with grid_columnconfigure? Using grid requires these steps: use the grid method of the text widget, giving it a row and column. In this case you can use 0,0. also with the grid method, define whether or not you want the widget to "stick" to the sides of the

matplotlib: Setting both major and minor ticks forces same x and y scale

一个人想着一个人 提交于 2019-12-04 17:19:54
This question is related to the earlier question I asked " matplotlib: Change grid interval and specify tick labels " but now I want to change the scale for x and y axes. When I set the range for x and y axes and then specify the intervals for major and minor ticks, it forces the x and y axes to be the same. This is my code. import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.add_subplot(111) for key, value in sorted(data.items()): x = value[0][2] y = value[0][3] count = value[0][4] ax.annotate(count, xy = (x, y), size = 3) plt.suptitle('Number of counts', fontsize =

Snap to grid mouse locking up

徘徊边缘 提交于 2019-12-04 17:04:38
I am working on an application which draws a simple dot grid. I would like the mouse to snap between the points on the grid, eventually to draw lines on the grid. I have a method which takes in the current mouse location (X,Y) and calculates the nearest grid coordinate. When I create an event and attempt to move the mouse to the new coordinate the whole system becomes jerky. The mouse doesn't snap smoothly between grid points. I have copied a code sample below to illustrate what I am attempting to do. Does anyone have any advice they could offer me as to how I can eliminate the jumpiness

Using a Grid as an ItemsHost

孤街醉人 提交于 2019-12-04 16:22:55
I would like to use a Grid as an ItemsHost but none of the items appear in their bound (column, row) positions. How can I make this work? As a simple example: XAML <ItemsControl ItemsSource="{Binding DataSet}"> <ItemsControl.ItemTemplate> <DataTemplate> <TextBlock Grid.Column="{Binding Col}" Grid.Row="{Binding Row}" Text="{Binding Text}" /> </DataTemplate> </ItemsControl.ItemTemplate> <ItemsControl.Style> <Style TargetType="{x:Type ItemsControl}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ItemsControl}"> <Grid HorizontalAlignment="Stretch" IsItemsHost=

div grid of squares, float:left issue (image included)

故事扮演 提交于 2019-12-04 16:15:56
i am trying to make a grid in such a way that it is always the same size overall (800x600). however, i do not want all squares in a grid to be of the same size. as you can see as soon as i make one square bigger (2x2+gap - colored silver in the image) all the rest of the smaller squares do not realign and start from the start of the next row - creating a WHITE gap in row two. is there a way to fix this? here is the CSS for them: .squareTEST1, .squareTEST2 { width: 60px; height: 60px; margin: 3px; float: left; } .squareTEST1A { width: 126px; height: 126px; margin: 3px; float: left; background

How to manage PagingToolbar in Ext-js 4.2 correctly?

风格不统一 提交于 2019-12-04 16:06:51
js 4.2), and I've got some problems when I manage a toolbar on a grid which use a Proxy (ajax). this.grid = new Ext.create('Ext.grid.Panel',{ region : 'center', loadMask : true, layout : 'fit', store : 'Contenedores', tbar: [ { text: 'Exportar Excel' }, '->', { text:'Buscar', handler: this.buscar, scope: this}, '-', { text:'Limpiar', handler: this.limpiar, scope: this} ], columns : [], bbar : new Ext.create('Ext.toolbar.Paging',{ store: 'Contenedores', displayInfo: true, displayMsg : 'Registros {0} - {1} de {2}', emptyMsg : 'No hay registros' }) }); The problems, I'm having are: When I call to

How to fill color in grid boxes randomly

白昼怎懂夜的黑 提交于 2019-12-04 16:02:18
How can I fill color on the grid boxes randomly? Rather than orderly as shown in picture here: Grid http://www.freeimagehosting.net/uploads/4ed76557de.jpg public class grid extends JPanel{ Label one = new Label(); Label two = new Label(); Label three = new Label(); Label four = new Label(); public static void main(String[] args){ JFrame jf=new JFrame(); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jf.add(new YAnswers()); jf.pack(); jf.setVisible(true); } grid (){ int rows=10; int cols=10; setLayout(new GridLayout(rows,cols)); add(one); one.setBackground(Color.red); add(two); two

Can a gridpane automatically resize it's objects to fit? Trying to set a max_width and max_height to a grid and have it resize content. JavaFX

ぃ、小莉子 提交于 2019-12-04 14:54:31
I have a simple question. Can a grid automatically resize the objects in it to fit the grid? I want to set a max_height and max_width on a grid as well as a min-width and min-height and center that grid in my window. In my grid, I want to add Spacer Square in all spots. Each spacer has a border. So it will look like an actual grid. If my grid is 4x4, I want there to be 16 big squares. If my grid is 16x18, I want there to be 288 squares. Both options should take up an area of a set amount, the 288 square option having squares a lot smaller than the 16 option in order to fit my grid dimensions.

Creating a dynamic grid of divs with Javascript

☆樱花仙子☆ 提交于 2019-12-04 14:07:15
问题 I want to create a grid of HTML divs that will have the same number of rows and columns but with the number of rows/columns being based on a particular number that would be passed to the Javascript function. e.g. if the number is 3 the grid will be 3 rows and 3 columns if the number is 4 the grid will be 4 rows and 4 columns..etc in the case of 3 the outputted code would need to look something like: <div class="row"> <div class="gridsquare">1</div> <div class="gridsquare">2</div> <div class=