How to push buttons to the right PySimpleGUI? - button

Dears,
Could you please help to share ideas on how to push Buttons to the right?
Knowing that I go through the forum and I find cases where no condition is set and this can be done using differents ways, like sg.push(), Sg.column(), justifications="right", but in my case bottouns are created based on one string as follows :
words= "S-C-I-E-N-C-E".split('-')
layout = [
[sg.Button(word, size=2) for word in words], => What to add in this line to make Buttons push to the right ?
Thanks in avdance

Check out sg.Push in the documentation. You will need something to the left for the push to push against. Perhaps an empty text column followed by push followed by the buttons.
For example:
[sg.Text(new_query,key='-QUERYNAME-'),
sg.Push(),
sg.Button(run_event,tooltip='Run (F5)')]
Gives me this:
You probably want something like:
layout = [sg.Text(''), sg.Push(), [sg.Button(word, size=2) for word in words]]

Related

Acucobol how to set cell-data of a grid

I've got a grid called grid-01 in an Acucobol program and I'm trying to change a specific grid cell. I know from the documentation that this should be possible. (See https://www.microfocus.com/documentation/extend-acucobol/925/BKINRHINUI4Z.html)
From that I can tell that I'm supposed to use the SET statement. It also talks about an INQUIRE statement, which I actually did get to work.
This code works to INQUIRE what's in the cell and put it in a variable:
inquire grid-01(ws-01-y, 13), cell-data in ws-inquired-cell-data
I tried to use the SET statement in the same way:
set grid-01(ws-01-y, 13), cell-data to ws-new-cell-data
But I get the following errors during compilation:
gridprogram.cob, line 4216: GRID-01: Screen name not allowed in this context
gridprogram.cob, line 4216: Undefined data item: GRID-01
gridprogram.cob, line 4216: Undefined data item: CELL-DATA
Can somebody tell me what I'm doing wrong? I tried scouring the documentation of the SET statement (https://www.microfocus.com/documentation/extend-acucobol/925/BKRFRFPROC00000001S169.html) but I can't figure out anything specific to grid cell-data in there that might be of any use.
I have found my issue. While I have 25 data columns set for this grid, only 8 columns are actually supposed to be displayed. Since the cell-data I want to change is in column 13, nothing happens even with the MODIFY statement. However, if I display all these columns, the MODIFY statement works as intended.
The next question is: how can I hide the display columns and still access the data? I thought that was what the data columns were supposed to be for. I can hide them visually by limiting virtual-width, but then I can still use the keyboard to move the cursor outside of the virtual boundary.
I am further confused about how I can inquire into the column 13 when it is not displayed, yet not modify it.

mvcgrid.net unable to use toolbar

I'm working on a website with a feature that can sort users.
I'm using mvcgrid.net libs but I can't figure it out. the toolbar doesn't work.
I used most of the basic source codes from mvcgrid.net but when i press something in the search bar it doesn't work or the items per page selection.
If you have specific code to take a look at, please post. Otherwise, here are a few things you can check:
(1) Be sure you've applied the mvcgrid data attributes needed. For example, for a search field you might have these attributes:
<input
type="search"
data-mvcgrid-apply-additional="change"
data-mvcgrid-type="additionalQueryOption"
data-mvcgrid-option="search"
data-mvcgrid-name="ContactGrid">
(2) Be sure the value you chose for mvcgrid-option (in this example, "search") is then added when you configure the grid. For example:
MVCGridDefinitionTable.Add("ContactGrid", new MVCGridBuilder<ContactViewModel>(defaults)
.WithAdditionalQueryOptionNames("Search")
...
(3) You then need to read the attribute (again in the grid config) in your .WithRetrieveDataMethod()
string search = options.GetAdditionalQueryOptionString("search");
I've forgotten step 2 in the past -- that's generally what has tripped me up.

check box in asp.net webform

I need help in check box my problem that when i select any one it gave me message
about my selection but when choose two of check box gave me the last choose of them why and what is the fix please
What is happening is that your Append status is wrong. Instead of appending, you are overwriting the current value. Hence when you choose say two answers, the first is overwritten by the second.
I think the problem is with the syntax of your Append status. Instead of:
Append(Label5.Text =("New Text"));
It should be something like:
Append(Label5.Text).Append("Your new text");
See:
https://msdn.microsoft.com/en-us/library/b4sc8ca8(v=vs.110).aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1

using the chrome console to select out data

I'm looking to pull out all of the companies from this page (https://angel.co/finder#AL_claimed=true&AL_LocationTag=1849&render_tags=1) in plain text. I saw someone use the Chrome Developer Tools console to do this and was wondering if anyone could point me in the right direction?
TLDR; How do I use Chrome console to select and pull out some data from a URL?
Note: since jQuery is available on this page, I'll just go ahead and use it.
First of all, we need to select elements that we want, e.g. names of the companies. These are being kept on the list with ID startups_content, inside elements with class items in a field with class name. Therefore, selector for these can look like this:
$('#startups_content .items .name a')
As a result, we will get bunch of HTMLElements. Since we want a plain text we need to extract it from these HTMLElements by doing:
.map(function(idx, item){ return $(item).text(); }).toArray()
Which gives us an array of company names. However, lets make a single plain text list out of it:
.join('\n')
Connecting all the steps above we get:
$('#startups_content .items .name a').map(function(idx, item){ return $(item).text(); }).toArray().join('\n');
which should be executed in the DevTools console.
If you need some other data, e.g. company URLs, just follow the same steps as described above doing appropriate changes.

How to enter values to a text field using monkeyrunner

I am trying to enter some text to a text field in my android application using Monkeyrunner.
I wrote the code like this:
device.press('KEYCODE_BUTTON_SELECT',MonkeyDevice.DOWN_AND_UP)
device.press('KEYCODE_U','DOWN_AND_UP')
device.press('KEYCODE_S','DOWN_AND_UP')
device.press('KEYCODE_E','DOWN_AND_UP')
device.press('KEYCODE_R','DOWN_AND_UP')
while running the first line,the text field is getting selected.But The string "user" is not typing there.But the same code i can run out of my application ,In the android native search field i can enter "user" string using this code. I tried the same with device.type('USER') command also.That is also not working
If i am using this code
device.press ('KEYCODE_DPAD_CENTER', MonkeyDevice.DOWN_AND_UP)
It is taping one center button. (In my application page one button is there in the middle of the page.)
Try the following code. It's working in my case:
device.touch(x, y, MonkeyDevice.DOWN_AND_UP)
MonkeyRunner.sleep(1)
device.type('USER')
In the command touch put the coordinates of your edittext instead of x and y
One of the challenges would be to find the coordinates to touch, mainly using different screen sizes and configurations.
AndroidViewClient can help in this respect and you can avoid having to provide the coordinates for the Views and you can simply do:
subject = vc.findViewByIdOrRaise('id/subject')
subject.touch()
subject.type('AVCSample')
this lines were taken from one of the AVC examples: email-send.py
Do you have space character as part of the text you're trying to enter? Try without space and see if that works. Then, you can figure out how to deal with space.

Resources